home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1990-09-04 | 113.0 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 05 63 73 65 2e 63 00 | 00 00 00 00 00 00 00 00 |..cse.c.|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 01 c1 0a 00 | 00 01 d0 a3 09 e4 de a3 |........|........|
|00000060| 09 e4 de 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 fb e9 00 00 |........|........|
|00000080| 2f 2a 20 43 6f 6d 6d 6f | 6e 20 73 75 62 65 78 70 |/* Commo|n subexp|
|00000090| 72 65 73 73 69 6f 6e 20 | 65 6c 69 6d 69 6e 61 74 |ression |eliminat|
|000000a0| 69 6f 6e 20 66 6f 72 20 | 47 4e 55 20 63 6f 6d 70 |ion for |GNU comp|
|000000b0| 69 6c 65 72 2e 0d 20 20 | 20 43 6f 70 79 72 69 67 |iler.. | Copyrig|
|000000c0| 68 74 20 28 43 29 20 31 | 39 38 37 2c 20 31 39 38 |ht (C) 1|987, 198|
|000000d0| 38 2c 20 31 39 38 39 20 | 46 72 65 65 20 53 6f 66 |8, 1989 |Free Sof|
|000000e0| 74 77 61 72 65 20 46 6f | 75 6e 64 61 74 69 6f 6e |tware Fo|undation|
|000000f0| 2c 20 49 6e 63 2e 0d 20 | 20 20 43 6f 70 79 72 69 |, Inc.. | Copyri|
|00000100| 67 68 74 20 28 43 29 20 | 31 39 38 39 2c 20 31 39 |ght (C) |1989, 19|
|00000110| 39 30 20 41 70 70 6c 65 | 20 43 6f 6d 70 75 74 65 |90 Apple| Compute|
|00000120| 72 2c 20 49 6e 63 2e 0d | 0d 54 68 69 73 20 66 69 |r, Inc..|.This fi|
|00000130| 6c 65 20 69 73 20 70 61 | 72 74 20 6f 66 20 47 4e |le is pa|rt of GN|
|00000140| 55 20 43 43 2e 0d 0d 47 | 4e 55 20 43 43 20 69 73 |U CC...G|NU CC is|
|00000150| 20 66 72 65 65 20 73 6f | 66 74 77 61 72 65 3b 20 | free so|ftware; |
|00000160| 79 6f 75 20 63 61 6e 20 | 72 65 64 69 73 74 72 69 |you can |redistri|
|00000170| 62 75 74 65 20 69 74 20 | 61 6e 64 2f 6f 72 20 6d |bute it |and/or m|
|00000180| 6f 64 69 66 79 0d 69 74 | 20 75 6e 64 65 72 20 74 |odify.it| under t|
|00000190| 68 65 20 74 65 72 6d 73 | 20 6f 66 20 74 68 65 20 |he terms| of the |
|000001a0| 47 4e 55 20 47 65 6e 65 | 72 61 6c 20 50 75 62 6c |GNU Gene|ral Publ|
|000001b0| 69 63 20 4c 69 63 65 6e | 73 65 20 61 73 20 70 75 |ic Licen|se as pu|
|000001c0| 62 6c 69 73 68 65 64 20 | 62 79 0d 74 68 65 20 46 |blished |by.the F|
|000001d0| 72 65 65 20 53 6f 66 74 | 77 61 72 65 20 46 6f 75 |ree Soft|ware Fou|
|000001e0| 6e 64 61 74 69 6f 6e 3b | 20 65 69 74 68 65 72 20 |ndation;| either |
|000001f0| 76 65 72 73 69 6f 6e 20 | 31 2c 20 6f 72 20 28 61 |version |1, or (a|
|00000200| 74 20 79 6f 75 72 20 6f | 70 74 69 6f 6e 29 0d 61 |t your o|ption).a|
|00000210| 6e 79 20 6c 61 74 65 72 | 20 76 65 72 73 69 6f 6e |ny later| version|
|00000220| 2e 0d 0d 47 4e 55 20 43 | 43 20 69 73 20 64 69 73 |...GNU C|C is dis|
|00000230| 74 72 69 62 75 74 65 64 | 20 69 6e 20 74 68 65 20 |tributed| in the |
|00000240| 68 6f 70 65 20 74 68 61 | 74 20 69 74 20 77 69 6c |hope tha|t it wil|
|00000250| 6c 20 62 65 20 75 73 65 | 66 75 6c 2c 0d 62 75 74 |l be use|ful,.but|
|00000260| 20 57 49 54 48 4f 55 54 | 20 41 4e 59 20 57 41 52 | WITHOUT| ANY WAR|
|00000270| 52 41 4e 54 59 3b 20 77 | 69 74 68 6f 75 74 20 65 |RANTY; w|ithout e|
|00000280| 76 65 6e 20 74 68 65 20 | 69 6d 70 6c 69 65 64 20 |ven the |implied |
|00000290| 77 61 72 72 61 6e 74 79 | 20 6f 66 0d 4d 45 52 43 |warranty| of.MERC|
|000002a0| 48 41 4e 54 41 42 49 4c | 49 54 59 20 6f 72 20 46 |HANTABIL|ITY or F|
|000002b0| 49 54 4e 45 53 53 20 46 | 4f 52 20 41 20 50 41 52 |ITNESS F|OR A PAR|
|000002c0| 54 49 43 55 4c 41 52 20 | 50 55 52 50 4f 53 45 2e |TICULAR |PURPOSE.|
|000002d0| 20 20 53 65 65 20 74 68 | 65 0d 47 4e 55 20 47 65 | See th|e.GNU Ge|
|000002e0| 6e 65 72 61 6c 20 50 75 | 62 6c 69 63 20 4c 69 63 |neral Pu|blic Lic|
|000002f0| 65 6e 73 65 20 66 6f 72 | 20 6d 6f 72 65 20 64 65 |ense for| more de|
|00000300| 74 61 69 6c 73 2e 0d 0d | 59 6f 75 20 73 68 6f 75 |tails...|You shou|
|00000310| 6c 64 20 68 61 76 65 20 | 72 65 63 65 69 76 65 64 |ld have |received|
|00000320| 20 61 20 63 6f 70 79 20 | 6f 66 20 74 68 65 20 47 | a copy |of the G|
|00000330| 4e 55 20 47 65 6e 65 72 | 61 6c 20 50 75 62 6c 69 |NU Gener|al Publi|
|00000340| 63 20 4c 69 63 65 6e 73 | 65 0d 61 6c 6f 6e 67 20 |c Licens|e.along |
|00000350| 77 69 74 68 20 47 4e 55 | 20 43 43 3b 20 73 65 65 |with GNU| CC; see|
|00000360| 20 74 68 65 20 66 69 6c | 65 20 43 4f 50 59 49 4e | the fil|e COPYIN|
|00000370| 47 2e 20 20 49 66 20 6e | 6f 74 2c 20 77 72 69 74 |G. If n|ot, writ|
|00000380| 65 20 74 6f 0d 74 68 65 | 20 46 72 65 65 20 53 6f |e to.the| Free So|
|00000390| 66 74 77 61 72 65 20 46 | 6f 75 6e 64 61 74 69 6f |ftware F|oundatio|
|000003a0| 6e 2c 20 36 37 35 20 4d | 61 73 73 20 41 76 65 2c |n, 675 M|ass Ave,|
|000003b0| 20 43 61 6d 62 72 69 64 | 67 65 2c 20 4d 41 20 30 | Cambrid|ge, MA 0|
|000003c0| 32 31 33 39 2c 20 55 53 | 41 2e 20 20 2a 2f 0d 0d |2139, US|A. */..|
|000003d0| 0d 23 69 6e 63 6c 75 64 | 65 20 22 63 6f 6e 66 69 |.#includ|e "confi|
|000003e0| 67 2e 68 22 0d 23 69 6e | 63 6c 75 64 65 20 22 72 |g.h".#in|clude "r|
|000003f0| 74 6c 2e 68 22 0d 23 69 | 6e 63 6c 75 64 65 20 22 |tl.h".#i|nclude "|
|00000400| 72 65 67 73 2e 68 22 0d | 23 69 6e 63 6c 75 64 65 |regs.h".|#include|
|00000410| 20 22 68 61 72 64 2d 72 | 65 67 2d 73 65 74 2e 68 | "hard-r|eg-set.h|
|00000420| 22 0d 23 69 6e 63 6c 75 | 64 65 20 22 66 6c 61 67 |".#inclu|de "flag|
|00000430| 73 2e 68 22 0d 23 69 6e | 63 6c 75 64 65 20 22 72 |s.h".#in|clude "r|
|00000440| 65 61 6c 2e 68 22 0d 0d | 23 69 6e 63 6c 75 64 65 |eal.h"..|#include|
|00000450| 20 3c 73 65 74 6a 6d 70 | 2e 68 3e 0d 0d 23 69 66 | <setjmp|.h>..#if|
|00000460| 64 65 66 20 4d 50 57 0d | 23 69 6e 63 6c 75 64 65 |def MPW.|#include|
|00000470| 20 3c 43 75 72 73 6f 72 | 43 74 6c 2e 68 3e 0d 23 | <Cursor|Ctl.h>.#|
|00000480| 65 6e 64 69 66 0d 0d 2f | 2a 20 54 68 65 20 62 61 |endif../|* The ba|
|00000490| 73 69 63 20 69 64 65 61 | 20 6f 66 20 63 6f 6d 6d |sic idea| of comm|
|000004a0| 6f 6e 20 73 75 62 65 78 | 70 72 65 73 73 69 6f 6e |on subex|pression|
|000004b0| 20 65 6c 69 6d 69 6e 61 | 74 69 6f 6e 20 69 73 20 | elimina|tion is |
|000004c0| 74 6f 20 67 6f 0d 20 20 | 20 74 68 72 6f 75 67 68 |to go. | through|
|000004d0| 20 74 68 65 20 63 6f 64 | 65 2c 20 6b 65 65 70 69 | the cod|e, keepi|
|000004e0| 6e 67 20 61 20 72 65 63 | 6f 72 64 20 6f 66 20 65 |ng a rec|ord of e|
|000004f0| 78 70 72 65 73 73 69 6f | 6e 73 20 74 68 61 74 20 |xpressio|ns that |
|00000500| 77 6f 75 6c 64 0d 20 20 | 20 68 61 76 65 20 74 68 |would. | have th|
|00000510| 65 20 73 61 6d 65 20 76 | 61 6c 75 65 20 61 74 20 |e same v|alue at |
|00000520| 74 68 65 20 63 75 72 72 | 65 6e 74 20 73 63 61 6e |the curr|ent scan|
|00000530| 20 70 6f 69 6e 74 2c 20 | 61 6e 64 20 72 65 70 6c | point, |and repl|
|00000540| 61 63 69 6e 67 0d 20 20 | 20 65 78 70 72 65 73 73 |acing. | express|
|00000550| 69 6f 6e 73 20 65 6e 63 | 6f 75 6e 74 65 72 65 64 |ions enc|ountered|
|00000560| 20 77 69 74 68 20 74 68 | 65 20 63 68 65 61 70 65 | with th|e cheape|
|00000570| 73 74 20 65 71 75 69 76 | 61 6c 65 6e 74 20 65 78 |st equiv|alent ex|
|00000580| 70 72 65 73 73 69 6f 6e | 2e 0d 0d 20 20 20 49 74 |pression|... It|
|00000590| 20 69 73 20 74 6f 6f 20 | 63 6f 6d 70 6c 69 63 61 | is too |complica|
|000005a0| 74 65 64 20 74 6f 20 6b | 65 65 70 20 74 72 61 63 |ted to k|eep trac|
|000005b0| 6b 20 6f 66 20 74 68 65 | 20 64 69 66 66 65 72 65 |k of the| differe|
|000005c0| 6e 74 20 70 6f 73 73 69 | 62 69 6c 69 74 69 65 73 |nt possi|bilities|
|000005d0| 0d 20 20 20 77 68 65 6e | 20 63 6f 6e 74 72 6f 6c |. when| control|
|000005e0| 20 70 61 74 68 73 20 6d | 65 72 67 65 3b 20 73 6f | paths m|erge; so|
|000005f0| 2c 20 61 74 20 65 61 63 | 68 20 6c 61 62 65 6c 2c |, at eac|h label,|
|00000600| 20 77 65 20 66 6f 72 67 | 65 74 20 61 6c 6c 20 74 | we forg|et all t|
|00000610| 68 61 74 20 69 73 0d 20 | 20 20 6b 6e 6f 77 6e 20 |hat is. | known |
|00000620| 61 6e 64 20 73 74 61 72 | 74 20 66 72 65 73 68 2e |and star|t fresh.|
|00000630| 20 20 54 68 69 73 20 63 | 61 6e 20 62 65 20 64 65 | This c|an be de|
|00000640| 73 63 72 69 62 65 64 20 | 61 73 20 70 72 6f 63 65 |scribed |as proce|
|00000650| 73 73 69 6e 67 20 65 61 | 63 68 0d 20 20 20 62 61 |ssing ea|ch. ba|
|00000660| 73 69 63 20 62 6c 6f 63 | 6b 20 73 65 70 61 72 61 |sic bloc|k separa|
|00000670| 74 65 6c 79 2e 20 20 4e | 6f 74 65 2c 20 68 6f 77 |tely. N|ote, how|
|00000680| 65 76 65 72 2c 20 74 68 | 61 74 20 74 68 65 73 65 |ever, th|at these|
|00000690| 20 61 72 65 20 6e 6f 74 | 20 71 75 69 74 65 0d 20 | are not| quite. |
|000006a0| 20 20 74 68 65 20 73 61 | 6d 65 20 61 73 20 74 68 | the sa|me as th|
|000006b0| 65 20 62 61 73 69 63 20 | 62 6c 6f 63 6b 73 20 66 |e basic |blocks f|
|000006c0| 6f 75 6e 64 20 62 79 20 | 61 20 6c 61 74 65 72 20 |ound by |a later |
|000006d0| 70 61 73 73 20 61 6e 64 | 20 75 73 65 64 20 66 6f |pass and| used fo|
|000006e0| 72 0d 20 20 20 64 61 74 | 61 20 66 6c 6f 77 20 61 |r. dat|a flow a|
|000006f0| 6e 61 6c 79 73 69 73 20 | 61 6e 64 20 72 65 67 69 |nalysis |and regi|
|00000700| 73 74 65 72 20 70 61 63 | 6b 69 6e 67 2e 20 20 57 |ster pac|king. W|
|00000710| 65 20 64 6f 20 6e 6f 74 | 20 6e 65 65 64 20 74 6f |e do not| need to|
|00000720| 20 73 74 61 72 74 20 66 | 72 65 73 68 0d 20 20 20 | start f|resh. |
|00000730| 61 66 74 65 72 20 61 20 | 63 6f 6e 64 69 74 69 6f |after a |conditio|
|00000740| 6e 61 6c 20 6a 75 6d 70 | 20 69 6e 73 74 72 75 63 |nal jump| instruc|
|00000750| 74 69 6f 6e 20 69 66 20 | 74 68 65 72 65 20 69 73 |tion if |there is|
|00000760| 20 6e 6f 20 6c 61 62 65 | 6c 20 74 68 65 72 65 2e | no labe|l there.|
|00000770| 0d 0d 20 20 20 57 65 20 | 75 73 65 20 74 77 6f 20 |.. We |use two |
|00000780| 64 61 74 61 20 73 74 72 | 75 63 74 75 72 65 73 20 |data str|uctures |
|00000790| 74 6f 20 72 65 63 6f 72 | 64 20 74 68 65 20 65 71 |to recor|d the eq|
|000007a0| 75 69 76 61 6c 65 6e 74 | 20 65 78 70 72 65 73 73 |uivalent| express|
|000007b0| 69 6f 6e 73 3a 0d 20 20 | 20 61 20 68 61 73 68 20 |ions:. | a hash |
|000007c0| 74 61 62 6c 65 20 66 6f | 72 20 6d 6f 73 74 20 65 |table fo|r most e|
|000007d0| 78 70 72 65 73 73 69 6f | 6e 73 2c 20 61 6e 64 20 |xpressio|ns, and |
|000007e0| 73 65 76 65 72 61 6c 20 | 76 65 63 74 6f 72 73 20 |several |vectors |
|000007f0| 74 6f 67 65 74 68 65 72 | 0d 20 20 20 77 69 74 68 |together|. with|
|00000800| 20 22 71 75 61 6e 74 69 | 74 79 20 6e 75 6d 62 65 | "quanti|ty numbe|
|00000810| 72 73 22 20 74 6f 20 72 | 65 63 6f 72 64 20 65 71 |rs" to r|ecord eq|
|00000820| 75 69 76 61 6c 65 6e 74 | 20 28 70 73 65 75 64 6f |uivalent| (pseudo|
|00000830| 29 20 72 65 67 69 73 74 | 65 72 73 2e 0d 0d 20 20 |) regist|ers... |
|00000840| 20 54 68 65 20 75 73 65 | 20 6f 66 20 74 68 65 20 | The use| of the |
|00000850| 73 70 65 63 69 61 6c 20 | 64 61 74 61 20 73 74 72 |special |data str|
|00000860| 75 63 74 75 72 65 20 66 | 6f 72 20 72 65 67 69 73 |ucture f|or regis|
|00000870| 74 65 72 73 20 69 73 20 | 64 65 73 69 72 61 62 6c |ters is |desirabl|
|00000880| 65 0d 20 20 20 62 65 63 | 61 75 73 65 20 69 74 20 |e. bec|ause it |
|00000890| 69 73 20 66 61 73 74 65 | 72 2e 20 20 49 74 20 69 |is faste|r. It i|
|000008a0| 73 20 70 6f 73 73 69 62 | 6c 65 20 62 65 63 61 75 |s possib|le becau|
|000008b0| 73 65 20 72 65 67 69 73 | 74 65 72 73 20 72 65 66 |se regis|ters ref|
|000008c0| 65 72 65 6e 63 65 73 0d | 20 20 20 63 6f 6e 74 61 |erences.| conta|
|000008d0| 69 6e 20 61 20 66 61 69 | 72 6c 79 20 73 6d 61 6c |in a fai|rly smal|
|000008e0| 6c 20 6e 75 6d 62 65 72 | 2c 20 74 68 65 20 72 65 |l number|, the re|
|000008f0| 67 69 73 74 65 72 20 6e | 75 6d 62 65 72 2c 20 74 |gister n|umber, t|
|00000900| 61 6b 65 6e 20 66 72 6f | 6d 0d 20 20 20 61 20 63 |aken fro|m. a c|
|00000910| 6f 6e 74 69 67 75 6f 75 | 73 6c 79 20 61 6c 6c 6f |ontiguou|sly allo|
|00000920| 63 61 74 65 64 20 73 65 | 72 69 65 73 2c 20 61 6e |cated se|ries, an|
|00000930| 64 20 74 77 6f 20 72 65 | 67 69 73 74 65 72 20 72 |d two re|gister r|
|00000940| 65 66 65 72 65 6e 63 65 | 73 20 61 72 65 0d 20 20 |eference|s are. |
|00000950| 20 69 64 65 6e 74 69 63 | 61 6c 20 69 66 20 74 68 | identic|al if th|
|00000960| 65 79 20 68 61 76 65 20 | 74 68 65 20 73 61 6d 65 |ey have |the same|
|00000970| 20 6e 75 6d 62 65 72 2e | 20 20 47 65 6e 65 72 61 | number.| Genera|
|00000980| 6c 20 65 78 70 72 65 73 | 73 69 6f 6e 73 0d 20 20 |l expres|sions. |
|00000990| 20 64 6f 20 6e 6f 74 20 | 68 61 76 65 20 61 6e 79 | do not |have any|
|000009a0| 20 73 75 63 68 20 74 68 | 69 6e 67 2c 20 73 6f 20 | such th|ing, so |
|000009b0| 74 68 65 20 6f 6e 6c 79 | 20 77 61 79 20 74 6f 20 |the only| way to |
|000009c0| 72 65 74 72 69 65 76 65 | 20 74 68 65 0d 20 20 20 |retrieve| the. |
|000009d0| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 72 65 63 6f |informat|ion reco|
|000009e0| 72 64 65 64 20 6f 6e 20 | 61 6e 20 65 78 70 72 65 |rded on |an expre|
|000009f0| 73 73 69 6f 6e 20 6f 74 | 68 65 72 20 74 68 61 6e |ssion ot|her than|
|00000a00| 20 61 20 72 65 67 69 73 | 74 65 72 0d 20 20 20 69 | a regis|ter. i|
|00000a10| 73 20 74 6f 20 6b 65 65 | 70 20 69 74 20 69 6e 20 |s to kee|p it in |
|00000a20| 61 20 68 61 73 68 20 74 | 61 62 6c 65 2e 0d 0d 52 |a hash t|able...R|
|00000a30| 65 67 69 73 74 65 72 73 | 20 61 6e 64 20 22 71 75 |egisters| and "qu|
|00000a40| 61 6e 74 69 74 79 20 6e | 75 6d 62 65 72 73 22 3a |antity n|umbers":|
|00000a50| 0d 20 20 20 0d 20 20 20 | 41 74 20 74 68 65 20 73 |. . |At the s|
|00000a60| 74 61 72 74 20 6f 66 20 | 65 61 63 68 20 62 61 73 |tart of |each bas|
|00000a70| 69 63 20 62 6c 6f 63 6b | 2c 20 61 6c 6c 20 6f 66 |ic block|, all of|
|00000a80| 20 74 68 65 20 28 68 61 | 72 64 77 61 72 65 20 61 | the (ha|rdware a|
|00000a90| 6e 64 20 70 73 65 75 64 | 6f 29 0d 20 20 20 72 65 |nd pseud|o). re|
|00000aa0| 67 69 73 74 65 72 73 20 | 75 73 65 64 20 69 6e 20 |gisters |used in |
|00000ab0| 74 68 65 20 66 75 6e 63 | 74 69 6f 6e 20 61 72 65 |the func|tion are|
|00000ac0| 20 67 69 76 65 6e 20 64 | 69 73 74 69 6e 63 74 20 | given d|istinct |
|00000ad0| 71 75 61 6e 74 69 74 79 | 0d 20 20 20 6e 75 6d 62 |quantity|. numb|
|00000ae0| 65 72 73 20 74 6f 20 69 | 6e 64 69 63 61 74 65 20 |ers to i|ndicate |
|00000af0| 74 68 65 69 72 20 63 6f | 6e 74 65 6e 74 73 2e 20 |their co|ntents. |
|00000b00| 20 44 75 72 69 6e 67 20 | 73 63 61 6e 2c 20 77 68 | During |scan, wh|
|00000b10| 65 6e 20 74 68 65 20 63 | 6f 64 65 0d 20 20 20 63 |en the c|ode. c|
|00000b20| 6f 70 69 65 73 20 6f 6e | 65 20 72 65 67 69 73 74 |opies on|e regist|
|00000b30| 65 72 20 69 6e 74 6f 20 | 61 6e 6f 74 68 65 72 2c |er into |another,|
|00000b40| 20 77 65 20 63 6f 70 79 | 20 74 68 65 20 71 75 61 | we copy| the qua|
|00000b50| 6e 74 69 74 79 20 6e 75 | 6d 62 65 72 2e 0d 20 20 |ntity nu|mber.. |
|00000b60| 20 57 68 65 6e 20 61 20 | 72 65 67 69 73 74 65 72 | When a |register|
|00000b70| 20 69 73 20 6c 6f 61 64 | 65 64 20 69 6e 20 61 6e | is load|ed in an|
|00000b80| 79 20 6f 74 68 65 72 20 | 77 61 79 2c 20 77 65 20 |y other |way, we |
|00000b90| 61 6c 6c 6f 63 61 74 65 | 20 61 20 6e 65 77 0d 20 |allocate| a new. |
|00000ba0| 20 20 71 75 61 6e 74 69 | 74 79 20 6e 75 6d 62 65 | quanti|ty numbe|
|00000bb0| 72 20 74 6f 20 64 65 73 | 63 72 69 62 65 20 74 68 |r to des|cribe th|
|00000bc0| 65 20 76 61 6c 75 65 20 | 67 65 6e 65 72 61 74 65 |e value |generate|
|00000bd0| 64 20 62 79 20 74 68 69 | 73 20 6f 70 65 72 61 74 |d by thi|s operat|
|00000be0| 69 6f 6e 2e 0d 20 20 20 | 60 72 65 67 5f 71 74 79 |ion.. |`reg_qty|
|00000bf0| 27 20 72 65 63 6f 72 64 | 73 20 77 68 61 74 20 71 |' record|s what q|
|00000c00| 75 61 6e 74 69 74 79 20 | 61 20 72 65 67 69 73 74 |uantity |a regist|
|00000c10| 65 72 20 69 73 20 63 75 | 72 72 65 6e 74 6c 79 20 |er is cu|rrently |
|00000c20| 74 68 6f 75 67 68 74 0d | 20 20 20 6f 66 20 61 73 |thought.| of as|
|00000c30| 20 63 6f 6e 74 61 69 6e | 69 6e 67 2e 0d 0d 20 20 | contain|ing... |
|00000c40| 20 57 65 20 61 6c 73 6f | 20 6d 61 69 6e 74 61 69 | We also| maintai|
|00000c50| 6e 20 61 20 62 69 64 69 | 72 65 63 74 69 6f 6e 61 |n a bidi|rectiona|
|00000c60| 6c 20 63 68 61 69 6e 20 | 6f 66 20 72 65 67 69 73 |l chain |of regis|
|00000c70| 74 65 72 73 20 66 6f 72 | 20 65 61 63 68 0d 20 20 |ters for| each. |
|00000c80| 20 71 75 61 6e 74 69 74 | 79 20 6e 75 6d 62 65 72 | quantit|y number|
|00000c90| 2e 20 20 60 71 74 79 5f | 66 69 72 73 74 5f 72 65 |. `qty_|first_re|
|00000ca0| 67 27 2c 20 60 71 74 79 | 5f 6c 61 73 74 5f 72 65 |g', `qty|_last_re|
|00000cb0| 67 27 2c 0d 20 20 20 60 | 72 65 67 5f 6e 65 78 74 |g',. `|reg_next|
|00000cc0| 5f 65 71 76 27 20 61 6e | 64 20 60 72 65 67 5f 70 |_eqv' an|d `reg_p|
|00000cd0| 72 65 76 5f 65 71 76 27 | 20 68 6f 6c 64 20 74 68 |rev_eqv'| hold th|
|00000ce0| 65 73 65 20 63 68 61 69 | 6e 73 2e 0d 0d 20 20 20 |ese chai|ns... |
|00000cf0| 54 68 65 20 66 69 72 73 | 74 20 72 65 67 69 73 74 |The firs|t regist|
|00000d00| 65 72 20 69 6e 20 61 20 | 63 68 61 69 6e 20 69 73 |er in a |chain is|
|00000d10| 20 74 68 65 20 6f 6e 65 | 20 77 68 6f 73 65 20 6c | the one| whose l|
|00000d20| 69 66 65 73 70 61 6e 20 | 69 73 20 6c 65 61 73 74 |ifespan |is least|
|00000d30| 20 6c 6f 63 61 6c 2e 0d | 20 20 20 41 6d 6f 6e 67 | local..| Among|
|00000d40| 20 65 71 75 61 6c 73 2c | 20 69 74 20 69 73 20 74 | equals,| it is t|
|00000d50| 68 65 20 6f 6e 65 20 74 | 68 61 74 20 77 61 73 20 |he one t|hat was |
|00000d60| 73 65 65 6e 20 66 69 72 | 73 74 2e 0d 20 20 20 57 |seen fir|st.. W|
|00000d70| 65 20 72 65 70 6c 61 63 | 65 20 61 6e 79 20 65 71 |e replac|e any eq|
|00000d80| 75 69 76 61 6c 65 6e 74 | 20 72 65 67 69 73 74 65 |uivalent| registe|
|00000d90| 72 20 77 69 74 68 20 74 | 68 61 74 20 6f 6e 65 2e |r with t|hat one.|
|00000da0| 0d 0d 43 6f 6e 73 74 61 | 6e 74 73 20 61 6e 64 20 |..Consta|nts and |
|00000db0| 71 75 61 6e 74 69 74 79 | 20 6e 75 6d 62 65 72 73 |quantity| numbers|
|00000dc0| 0d 0d 20 20 20 57 68 65 | 6e 20 61 20 71 75 61 6e |.. Whe|n a quan|
|00000dd0| 74 69 74 79 20 68 61 73 | 20 61 20 6b 6e 6f 77 6e |tity has| a known|
|00000de0| 20 63 6f 6e 73 74 61 6e | 74 20 76 61 6c 75 65 2c | constan|t value,|
|00000df0| 20 74 68 61 74 20 76 61 | 6c 75 65 20 69 73 20 73 | that va|lue is s|
|00000e00| 74 6f 72 65 64 0d 20 20 | 20 69 6e 20 74 68 65 20 |tored. | in the |
|00000e10| 61 70 70 72 6f 70 72 69 | 61 74 65 20 65 6c 65 6d |appropri|ate elem|
|00000e20| 65 6e 74 20 6f 66 20 71 | 74 79 5f 63 6f 6e 73 74 |ent of q|ty_const|
|00000e30| 2e 20 20 54 68 69 73 20 | 69 73 20 69 6e 20 61 64 |. This |is in ad|
|00000e40| 64 69 74 69 6f 6e 20 74 | 6f 0d 20 20 20 70 75 74 |dition t|o. put|
|00000e50| 74 69 6e 67 20 74 68 65 | 20 63 6f 6e 73 74 61 6e |ting the| constan|
|00000e60| 74 20 69 6e 20 74 68 65 | 20 68 61 73 68 20 74 61 |t in the| hash ta|
|00000e70| 62 6c 65 20 61 73 20 69 | 73 20 75 73 75 61 6c 20 |ble as i|s usual |
|00000e80| 66 6f 72 20 6e 6f 6e 2d | 72 65 67 73 2e 0d 0d 20 |for non-|regs... |
|00000e90| 20 20 52 65 67 73 20 61 | 72 65 20 70 72 65 66 65 | Regs a|re prefe|
|00000ea0| 72 72 65 64 20 74 6f 20 | 63 6f 6e 73 74 61 6e 74 |rred to |constant|
|00000eb0| 73 20 61 73 20 74 68 65 | 79 20 61 72 65 20 74 6f |s as the|y are to|
|00000ec0| 20 65 76 65 72 79 74 68 | 69 6e 67 20 65 6c 73 65 | everyth|ing else|
|00000ed0| 2c 0d 20 20 20 62 75 74 | 20 65 78 70 72 65 73 73 |,. but| express|
|00000ee0| 69 6f 6e 73 20 63 6f 6e | 74 61 69 6e 69 6e 67 20 |ions con|taining |
|00000ef0| 63 6f 6e 73 74 61 6e 74 | 73 20 63 61 6e 20 62 65 |constant|s can be|
|00000f00| 20 73 69 6d 70 6c 69 66 | 69 65 64 2c 20 62 79 20 | simplif|ied, by |
|00000f10| 66 6f 6c 64 5f 72 74 78 | 2e 0d 0d 20 20 20 57 68 |fold_rtx|... Wh|
|00000f20| 65 6e 20 61 20 71 75 61 | 6e 74 69 74 79 20 68 61 |en a qua|ntity ha|
|00000f30| 73 20 61 20 6b 6e 6f 77 | 6e 20 6e 65 61 72 6c 79 |s a know|n nearly|
|00000f40| 20 63 6f 6e 73 74 61 6e | 74 20 76 61 6c 75 65 20 | constan|t value |
|00000f50| 28 73 75 63 68 20 61 73 | 20 61 6e 20 61 64 64 72 |(such as| an addr|
|00000f60| 65 73 73 0d 20 20 20 6f | 66 20 61 20 73 74 61 63 |ess. o|f a stac|
|00000f70| 6b 20 73 6c 6f 74 29 2c | 20 74 68 61 74 20 76 61 |k slot),| that va|
|00000f80| 6c 75 65 20 69 73 20 73 | 74 6f 72 65 64 20 69 6e |lue is s|tored in|
|00000f90| 20 74 68 65 20 61 70 70 | 72 6f 70 72 69 61 74 65 | the app|ropriate|
|00000fa0| 20 65 6c 65 6d 65 6e 74 | 0d 20 20 20 6f 66 20 71 | element|. of q|
|00000fb0| 74 79 5f 63 6f 6e 73 74 | 2e 0d 0d 20 20 20 49 6e |ty_const|... In|
|00000fc0| 74 65 67 65 72 20 63 6f | 6e 73 74 61 6e 74 73 20 |teger co|nstants |
|00000fd0| 64 6f 6e 27 74 20 68 61 | 76 65 20 61 20 6d 61 63 |don't ha|ve a mac|
|00000fe0| 68 69 6e 65 20 6d 6f 64 | 65 2e 20 20 48 6f 77 65 |hine mod|e. Howe|
|00000ff0| 76 65 72 2c 20 63 73 65 | 0d 20 20 20 64 65 74 65 |ver, cse|. dete|
|00001000| 72 6d 69 6e 65 73 20 74 | 68 65 20 69 6e 74 65 6e |rmines t|he inten|
|00001010| 64 65 64 20 6d 61 63 68 | 69 6e 65 20 6d 6f 64 65 |ded mach|ine mode|
|00001020| 20 66 72 6f 6d 20 74 68 | 65 20 64 65 73 74 69 6e | from th|e destin|
|00001030| 61 74 69 6f 6e 0d 20 20 | 20 6f 66 20 74 68 65 20 |ation. | of the |
|00001040| 69 6e 73 74 72 75 63 74 | 69 6f 6e 20 74 68 61 74 |instruct|ion that|
|00001050| 20 6d 6f 76 65 73 20 74 | 68 65 20 63 6f 6e 73 74 | moves t|he const|
|00001060| 61 6e 74 2e 20 20 54 68 | 65 20 6d 61 63 68 69 6e |ant. Th|e machin|
|00001070| 65 20 6d 6f 64 65 0d 20 | 20 20 69 73 20 72 65 63 |e mode. | is rec|
|00001080| 6f 72 64 65 64 20 69 6e | 20 74 68 65 20 68 61 73 |orded in| the has|
|00001090| 68 20 74 61 62 6c 65 20 | 61 6c 6f 6e 67 20 77 69 |h table |along wi|
|000010a0| 74 68 20 74 68 65 20 61 | 63 74 75 61 6c 20 52 54 |th the a|ctual RT|
|000010b0| 4c 0d 20 20 20 63 6f 6e | 73 74 61 6e 74 20 65 78 |L. con|stant ex|
|000010c0| 70 72 65 73 73 69 6f 6e | 20 73 6f 20 74 68 61 74 |pression| so that|
|000010d0| 20 64 69 66 66 65 72 65 | 6e 74 20 6d 6f 64 65 73 | differe|nt modes|
|000010e0| 20 61 72 65 20 6b 65 70 | 74 20 73 65 70 61 72 61 | are kep|t separa|
|000010f0| 74 65 2e 0d 0d 4f 74 68 | 65 72 20 65 78 70 72 65 |te...Oth|er expre|
|00001100| 73 73 69 6f 6e 73 3a 0d | 0d 20 20 20 54 6f 20 72 |ssions:.|. To r|
|00001110| 65 63 6f 72 64 20 6b 6e | 6f 77 6e 20 65 71 75 69 |ecord kn|own equi|
|00001120| 76 61 6c 65 6e 63 65 73 | 20 61 6d 6f 6e 67 20 65 |valences| among e|
|00001130| 78 70 72 65 73 73 69 6f | 6e 73 20 69 6e 20 67 65 |xpressio|ns in ge|
|00001140| 6e 65 72 61 6c 0d 20 20 | 20 77 65 20 75 73 65 20 |neral. | we use |
|00001150| 61 20 68 61 73 68 20 74 | 61 62 6c 65 20 63 61 6c |a hash t|able cal|
|00001160| 6c 65 64 20 60 74 61 62 | 6c 65 27 2e 20 20 49 74 |led `tab|le'. It|
|00001170| 20 68 61 73 20 61 20 66 | 69 78 65 64 20 6e 75 6d | has a f|ixed num|
|00001180| 62 65 72 20 6f 66 20 62 | 75 63 6b 65 74 73 0d 20 |ber of b|uckets. |
|00001190| 20 20 74 68 61 74 20 63 | 6f 6e 74 61 69 6e 20 63 | that c|ontain c|
|000011a0| 68 61 69 6e 73 20 6f 66 | 20 60 73 74 72 75 63 74 |hains of| `struct|
|000011b0| 20 74 61 62 6c 65 5f 65 | 6c 74 27 20 65 6c 65 6d | table_e|lt' elem|
|000011c0| 65 6e 74 73 20 66 6f 72 | 20 65 78 70 72 65 73 73 |ents for| express|
|000011d0| 69 6f 6e 73 2e 0d 20 20 | 20 54 68 65 73 65 20 63 |ions.. | These c|
|000011e0| 68 61 69 6e 73 20 63 6f | 6e 6e 65 63 74 20 74 68 |hains co|nnect th|
|000011f0| 65 20 65 6c 65 6d 65 6e | 74 73 20 77 68 6f 73 65 |e elemen|ts whose|
|00001200| 20 65 78 70 72 65 73 73 | 69 6f 6e 73 20 68 61 76 | express|ions hav|
|00001210| 65 20 74 68 65 20 73 61 | 6d 65 0d 20 20 20 68 61 |e the sa|me. ha|
|00001220| 73 68 20 63 6f 64 65 73 | 2e 0d 0d 20 20 20 4f 74 |sh codes|... Ot|
|00001230| 68 65 72 20 63 68 61 69 | 6e 73 20 74 68 72 6f 75 |her chai|ns throu|
|00001240| 67 68 20 74 68 65 20 73 | 61 6d 65 20 65 6c 65 6d |gh the s|ame elem|
|00001250| 65 6e 74 73 20 63 6f 6e | 6e 65 63 74 20 74 68 65 |ents con|nect the|
|00001260| 20 65 6c 65 6d 65 6e 74 | 73 20 77 68 69 63 68 0d | element|s which.|
|00001270| 20 20 20 63 75 72 72 65 | 6e 74 6c 79 20 68 61 76 | curre|ntly hav|
|00001280| 65 20 65 71 75 69 76 61 | 6c 65 6e 74 20 76 61 6c |e equiva|lent val|
|00001290| 75 65 73 2e 0d 0d 20 20 | 20 52 65 67 69 73 74 65 |ues... | Registe|
|000012a0| 72 20 72 65 66 65 72 65 | 6e 63 65 73 20 69 6e 20 |r refere|nces in |
|000012b0| 61 6e 20 65 78 70 72 65 | 73 73 69 6f 6e 20 61 72 |an expre|ssion ar|
|000012c0| 65 20 63 61 6e 6f 6e 69 | 63 61 6c 69 7a 65 64 20 |e canoni|calized |
|000012d0| 62 65 66 6f 72 65 20 68 | 61 73 68 69 6e 67 0d 20 |before h|ashing. |
|000012e0| 20 20 74 68 65 20 65 78 | 70 72 65 73 73 69 6f 6e | the ex|pression|
|000012f0| 2e 20 20 54 68 69 73 20 | 69 73 20 64 6f 6e 65 20 |. This |is done |
|00001300| 75 73 69 6e 67 20 60 72 | 65 67 5f 71 74 79 27 20 |using `r|eg_qty' |
|00001310| 61 6e 64 20 60 71 74 79 | 5f 66 69 72 73 74 5f 72 |and `qty|_first_r|
|00001320| 65 67 27 2e 0d 20 20 20 | 54 68 65 20 68 61 73 68 |eg'.. |The hash|
|00001330| 20 63 6f 64 65 20 6f 66 | 20 61 20 72 65 67 69 73 | code of| a regis|
|00001340| 74 65 72 20 72 65 66 65 | 72 65 6e 63 65 20 69 73 |ter refe|rence is|
|00001350| 20 63 6f 6d 70 75 74 65 | 64 20 75 73 69 6e 67 20 | compute|d using |
|00001360| 74 68 65 20 71 75 61 6e | 74 69 74 79 0d 20 20 20 |the quan|tity. |
|00001370| 6e 75 6d 62 65 72 2c 20 | 6e 6f 74 20 74 68 65 20 |number, |not the |
|00001380| 72 65 67 69 73 74 65 72 | 20 6e 75 6d 62 65 72 2e |register| number.|
|00001390| 0d 0d 20 20 20 57 68 65 | 6e 20 74 68 65 20 76 61 |.. Whe|n the va|
|000013a0| 6c 75 65 20 6f 66 20 61 | 6e 20 65 78 70 72 65 73 |lue of a|n expres|
|000013b0| 73 69 6f 6e 20 63 68 61 | 6e 67 65 73 2c 20 69 74 |sion cha|nges, it|
|000013c0| 20 69 73 20 6e 65 63 65 | 73 73 61 72 79 20 74 6f | is nece|ssary to|
|000013d0| 20 72 65 6d 6f 76 65 20 | 66 72 6f 6d 20 74 68 65 | remove |from the|
|000013e0| 0d 20 20 20 68 61 73 68 | 20 74 61 62 6c 65 20 6e |. hash| table n|
|000013f0| 6f 74 20 6a 75 73 74 20 | 74 68 61 74 20 65 78 70 |ot just |that exp|
|00001400| 72 65 73 73 69 6f 6e 20 | 62 75 74 20 61 6c 6c 20 |ression |but all |
|00001410| 65 78 70 72 65 73 73 69 | 6f 6e 73 20 77 68 6f 73 |expressi|ons whos|
|00001420| 65 20 76 61 6c 75 65 73 | 0d 20 20 20 63 6f 75 6c |e values|. coul|
|00001430| 64 20 62 65 20 64 69 66 | 66 65 72 65 6e 74 20 61 |d be dif|ferent a|
|00001440| 73 20 61 20 72 65 73 75 | 6c 74 2e 0d 0d 20 20 20 |s a resu|lt... |
|00001450| 20 20 31 2e 20 49 66 20 | 74 68 65 20 76 61 6c 75 | 1. If |the valu|
|00001460| 65 20 63 68 61 6e 67 69 | 6e 67 20 69 73 20 69 6e |e changi|ng is in|
|00001470| 20 6d 65 6d 6f 72 79 2c | 20 65 78 63 65 70 74 20 | memory,| except |
|00001480| 69 6e 20 73 70 65 63 69 | 61 6c 20 63 61 73 65 73 |in speci|al cases|
|00001490| 0d 20 20 20 20 20 41 4e | 59 54 48 49 4e 47 20 72 |. AN|YTHING r|
|000014a0| 65 66 65 72 72 69 6e 67 | 20 74 6f 20 6d 65 6d 6f |eferring| to memo|
|000014b0| 72 79 20 63 6f 75 6c 64 | 20 62 65 20 63 68 61 6e |ry could| be chan|
|000014c0| 67 65 64 2e 20 20 54 68 | 61 74 20 69 73 20 62 65 |ged. Th|at is be|
|000014d0| 63 61 75 73 65 0d 20 20 | 20 20 20 6e 6f 62 6f 64 |cause. | nobod|
|000014e0| 79 20 6b 6e 6f 77 73 20 | 77 68 65 72 65 20 61 20 |y knows |where a |
|000014f0| 70 6f 69 6e 74 65 72 20 | 64 6f 65 73 20 6e 6f 74 |pointer |does not|
|00001500| 20 70 6f 69 6e 74 2e 0d | 20 20 20 20 20 54 68 65 | point..| The|
|00001510| 20 66 75 6e 63 74 69 6f | 6e 20 60 69 6e 76 61 6c | functio|n `inval|
|00001520| 69 64 61 74 65 5f 6d 65 | 6d 6f 72 79 27 20 72 65 |idate_me|mory' re|
|00001530| 6d 6f 76 65 73 20 77 68 | 61 74 20 69 73 20 6e 65 |moves wh|at is ne|
|00001540| 63 65 73 73 61 72 79 2e | 0d 0d 20 20 20 20 20 54 |cessary.|.. T|
|00001550| 68 65 20 73 70 65 63 69 | 61 6c 20 63 61 73 65 73 |he speci|al cases|
|00001560| 20 61 72 65 20 77 68 65 | 6e 20 74 68 65 20 61 64 | are whe|n the ad|
|00001570| 64 72 65 73 73 20 69 73 | 20 63 6f 6e 73 74 61 6e |dress is| constan|
|00001580| 74 20 6f 72 20 69 73 0d | 20 20 20 20 20 61 20 63 |t or is.| a c|
|00001590| 6f 6e 73 74 61 6e 74 20 | 70 6c 75 73 20 61 20 66 |onstant |plus a f|
|000015a0| 69 78 65 64 20 72 65 67 | 69 73 74 65 72 20 73 75 |ixed reg|ister su|
|000015b0| 63 68 20 61 73 20 74 68 | 65 20 66 72 61 6d 65 20 |ch as th|e frame |
|000015c0| 70 6f 69 6e 74 65 72 0d | 20 20 20 20 20 6f 72 20 |pointer.| or |
|000015d0| 61 20 73 74 61 74 69 63 | 20 63 68 61 69 6e 20 70 |a static| chain p|
|000015e0| 6f 69 6e 74 65 72 2e 20 | 20 57 68 65 6e 20 73 75 |ointer. | When su|
|000015f0| 63 68 20 61 64 64 72 65 | 73 73 65 73 20 61 72 65 |ch addre|sses are|
|00001600| 20 73 74 6f 72 65 64 20 | 69 6e 2c 0d 20 20 20 20 | stored |in,. |
|00001610| 20 77 65 20 63 61 6e 20 | 74 65 6c 6c 20 65 78 61 | we can |tell exa|
|00001620| 63 74 6c 79 20 77 68 69 | 63 68 20 6f 74 68 65 72 |ctly whi|ch other|
|00001630| 20 73 75 63 68 20 61 64 | 64 72 65 73 73 65 73 20 | such ad|dresses |
|00001640| 6d 75 73 74 20 62 65 20 | 69 6e 76 61 6c 69 64 61 |must be |invalida|
|00001650| 74 65 64 0d 20 20 20 20 | 20 64 75 65 20 74 6f 20 |ted. | due to |
|00001660| 6f 76 65 72 6c 61 70 2e | 20 20 60 69 6e 76 61 6c |overlap.| `inval|
|00001670| 69 64 61 74 65 27 20 64 | 6f 65 73 20 74 68 69 73 |idate' d|oes this|
|00001680| 2e 0d 20 20 20 20 20 41 | 6c 6c 20 65 78 70 72 65 |.. A|ll expre|
|00001690| 73 73 69 6f 6e 73 20 74 | 68 61 74 20 72 65 66 65 |ssions t|hat refe|
|000016a0| 72 20 74 6f 20 6e 6f 6e | 2d 63 6f 6e 73 74 61 6e |r to non|-constan|
|000016b0| 74 0d 20 20 20 20 20 6d | 65 6d 6f 72 79 20 61 64 |t. m|emory ad|
|000016c0| 64 72 65 73 73 65 73 20 | 61 72 65 20 61 6c 73 6f |dresses |are also|
|000016d0| 20 69 6e 76 61 6c 69 64 | 61 74 65 64 2e 20 20 60 | invalid|ated. `|
|000016e0| 69 6e 76 61 6c 69 64 61 | 74 65 5f 6d 65 6d 6f 72 |invalida|te_memor|
|000016f0| 79 27 20 64 6f 65 73 20 | 74 68 69 73 2e 0d 0d 20 |y' does |this... |
|00001700| 20 20 20 20 32 2e 20 49 | 66 20 74 68 65 20 76 61 | 2. I|f the va|
|00001710| 6c 75 65 20 63 68 61 6e | 67 69 6e 67 20 69 73 20 |lue chan|ging is |
|00001720| 61 20 72 65 67 69 73 74 | 65 72 2c 20 61 6c 6c 20 |a regist|er, all |
|00001730| 65 78 70 72 65 73 73 69 | 6f 6e 73 0d 20 20 20 20 |expressi|ons. |
|00001740| 20 63 6f 6e 74 61 69 6e | 69 6e 67 20 72 65 66 65 | contain|ing refe|
|00001750| 72 65 6e 63 65 73 20 74 | 6f 20 74 68 61 74 20 72 |rences t|o that r|
|00001760| 65 67 69 73 74 65 72 2c | 20 61 6e 64 20 6f 6e 6c |egister,| and onl|
|00001770| 79 20 74 68 6f 73 65 2c | 0d 20 20 20 20 20 6d 75 |y those,|. mu|
|00001780| 73 74 20 62 65 20 72 65 | 6d 6f 76 65 64 2e 0d 0d |st be re|moved...|
|00001790| 20 20 20 42 65 63 61 75 | 73 65 20 73 65 61 72 63 | Becau|se searc|
|000017a0| 68 69 6e 67 20 74 68 65 | 20 65 6e 74 69 72 65 20 |hing the| entire |
|000017b0| 68 61 73 68 20 74 61 62 | 6c 65 20 66 6f 72 20 65 |hash tab|le for e|
|000017c0| 78 70 72 65 73 73 69 6f | 6e 73 20 74 68 61 74 20 |xpressio|ns that |
|000017d0| 63 6f 6e 74 61 69 6e 0d | 20 20 20 61 20 72 65 67 |contain.| a reg|
|000017e0| 69 73 74 65 72 20 69 73 | 20 76 65 72 79 20 73 6c |ister is| very sl|
|000017f0| 6f 77 2c 20 77 65 20 74 | 72 79 20 74 6f 20 66 69 |ow, we t|ry to fi|
|00001800| 67 75 72 65 20 6f 75 74 | 20 77 68 65 6e 20 69 74 |gure out| when it|
|00001810| 20 69 73 6e 27 74 20 6e | 65 63 65 73 73 61 72 79 | isn't n|ecessary|
|00001820| 2e 0d 20 20 20 50 72 65 | 63 69 73 65 6c 79 2c 20 |.. Pre|cisely, |
|00001830| 74 68 69 73 20 69 73 20 | 6e 65 63 65 73 73 61 72 |this is |necessar|
|00001840| 79 20 6f 6e 6c 79 20 77 | 68 65 6e 20 65 78 70 72 |y only w|hen expr|
|00001850| 65 73 73 69 6f 6e 73 20 | 68 61 76 65 20 62 65 65 |essions |have bee|
|00001860| 6e 0d 20 20 20 65 6e 74 | 65 72 65 64 20 69 6e 20 |n. ent|ered in |
|00001870| 74 68 65 20 68 61 73 68 | 20 74 61 62 6c 65 20 75 |the hash| table u|
|00001880| 73 69 6e 67 20 74 68 69 | 73 20 72 65 67 69 73 74 |sing thi|s regist|
|00001890| 65 72 2c 20 61 6e 64 20 | 74 68 65 6e 20 74 68 65 |er, and |then the|
|000018a0| 20 76 61 6c 75 65 20 68 | 61 73 0d 20 20 20 63 68 | value h|as. ch|
|000018b0| 61 6e 67 65 64 2c 20 61 | 6e 64 20 74 68 65 6e 20 |anged, a|nd then |
|000018c0| 61 6e 6f 74 68 65 72 20 | 65 78 70 72 65 73 73 69 |another |expressi|
|000018d0| 6f 6e 20 77 61 6e 74 73 | 20 74 6f 20 62 65 20 61 |on wants| to be a|
|000018e0| 64 64 65 64 20 74 6f 20 | 72 65 66 65 72 20 74 6f |dded to |refer to|
|000018f0| 0d 20 20 20 74 68 65 20 | 72 65 67 69 73 74 65 72 |. the |register|
|00001900| 27 73 20 6e 65 77 20 76 | 61 6c 75 65 2e 20 20 54 |'s new v|alue. T|
|00001910| 68 69 73 20 73 65 71 75 | 65 6e 63 65 20 6f 66 20 |his sequ|ence of |
|00001920| 63 69 72 63 75 6d 73 74 | 61 6e 63 65 73 20 69 73 |circumst|ances is|
|00001930| 20 72 61 72 65 0d 20 20 | 20 77 69 74 68 69 6e 20 | rare. | within |
|00001940| 61 6e 79 20 6f 6e 65 20 | 62 61 73 69 63 20 62 6c |any one |basic bl|
|00001950| 6f 63 6b 2e 0d 0d 20 20 | 20 54 68 65 20 76 65 63 |ock... | The vec|
|00001960| 74 6f 72 73 20 60 72 65 | 67 5f 74 69 63 6b 27 20 |tors `re|g_tick' |
|00001970| 61 6e 64 20 60 72 65 67 | 5f 69 6e 5f 74 61 62 6c |and `reg|_in_tabl|
|00001980| 65 27 20 61 72 65 20 75 | 73 65 64 20 74 6f 20 64 |e' are u|sed to d|
|00001990| 65 74 65 63 74 20 74 68 | 69 73 20 63 61 73 65 2e |etect th|is case.|
|000019a0| 0d 20 20 20 72 65 67 5f | 74 69 63 6b 5b 69 5d 20 |. reg_|tick[i] |
|000019b0| 69 73 20 69 6e 63 72 65 | 6d 65 6e 74 65 64 20 77 |is incre|mented w|
|000019c0| 68 65 6e 65 76 65 72 20 | 61 20 76 61 6c 75 65 20 |henever |a value |
|000019d0| 69 73 20 73 74 6f 72 65 | 64 20 69 6e 20 72 65 67 |is store|d in reg|
|000019e0| 69 73 74 65 72 20 69 2e | 0d 20 20 20 72 65 67 5f |ister i.|. reg_|
|000019f0| 69 6e 5f 74 61 62 6c 65 | 5b 69 5d 20 68 6f 6c 64 |in_table|[i] hold|
|00001a00| 73 20 2d 31 20 69 66 20 | 6e 6f 20 72 65 66 65 72 |s -1 if |no refer|
|00001a10| 65 6e 63 65 73 20 74 6f | 20 72 65 67 69 73 74 65 |ences to| registe|
|00001a20| 72 20 69 20 68 61 76 65 | 20 62 65 65 6e 0d 20 20 |r i have| been. |
|00001a30| 20 65 6e 74 65 72 65 64 | 20 69 6e 20 74 68 65 20 | entered| in the |
|00001a40| 74 61 62 6c 65 3b 20 6f | 74 68 65 72 77 69 73 65 |table; o|therwise|
|00001a50| 2c 20 69 74 20 63 6f 6e | 74 61 69 6e 73 20 74 68 |, it con|tains th|
|00001a60| 65 20 76 61 6c 75 65 20 | 72 65 67 5f 74 69 63 6b |e value |reg_tick|
|00001a70| 5b 69 5d 20 68 61 64 0d | 20 20 20 77 68 65 6e 20 |[i] had.| when |
|00001a80| 74 68 65 20 72 65 66 65 | 72 65 6e 63 65 73 20 77 |the refe|rences w|
|00001a90| 65 72 65 20 65 6e 74 65 | 72 65 64 2e 20 20 49 66 |ere ente|red. If|
|00001aa0| 20 77 65 20 77 61 6e 74 | 20 74 6f 20 65 6e 74 65 | we want| to ente|
|00001ab0| 72 20 61 20 72 65 66 65 | 72 65 6e 63 65 0d 20 20 |r a refe|rence. |
|00001ac0| 20 61 6e 64 20 72 65 67 | 5f 69 6e 5f 74 61 62 6c | and reg|_in_tabl|
|00001ad0| 65 5b 69 5d 20 21 3d 20 | 72 65 67 5f 74 69 63 6b |e[i] != |reg_tick|
|00001ae0| 5b 69 5d 2c 20 77 65 20 | 6d 75 73 74 20 73 63 61 |[i], we |must sca|
|00001af0| 6e 20 61 6e 64 20 72 65 | 6d 6f 76 65 20 6f 6c 64 |n and re|move old|
|00001b00| 20 72 65 66 65 72 65 6e | 63 65 73 2e 0d 20 20 20 | referen|ces.. |
|00001b10| 55 6e 74 69 6c 20 77 65 | 20 77 61 6e 74 20 74 6f |Until we| want to|
|00001b20| 20 65 6e 74 65 72 20 61 | 20 6e 65 77 20 65 6e 74 | enter a| new ent|
|00001b30| 72 79 2c 20 74 68 65 20 | 6d 65 72 65 20 66 61 63 |ry, the |mere fac|
|00001b40| 74 20 74 68 61 74 20 74 | 68 65 20 74 77 6f 20 76 |t that t|he two v|
|00001b50| 65 63 74 6f 72 73 0d 20 | 20 20 64 6f 6e 27 74 20 |ectors. | don't |
|00001b60| 6d 61 74 63 68 20 6d 61 | 6b 65 73 20 74 68 65 20 |match ma|kes the |
|00001b70| 65 6e 74 72 69 65 73 20 | 62 65 20 69 67 6e 6f 72 |entries |be ignor|
|00001b80| 65 64 20 69 66 20 61 6e | 79 6f 6e 65 20 74 72 69 |ed if an|yone tri|
|00001b90| 65 73 20 74 6f 20 6d 61 | 74 63 68 20 74 68 65 6d |es to ma|tch them|
|00001ba0| 2e 0d 0d 20 20 20 52 65 | 67 69 73 74 65 72 73 20 |... Re|gisters |
|00001bb0| 74 68 65 6d 73 65 6c 76 | 65 73 20 61 72 65 20 65 |themselv|es are e|
|00001bc0| 6e 74 65 72 65 64 20 69 | 6e 20 74 68 65 20 68 61 |ntered i|n the ha|
|00001bd0| 73 68 20 74 61 62 6c 65 | 20 61 73 20 77 65 6c 6c |sh table| as well|
|00001be0| 20 61 73 20 69 6e 0d 20 | 20 20 74 68 65 20 65 71 | as in. | the eq|
|00001bf0| 75 69 76 61 6c 65 6e 74 | 2d 72 65 67 69 73 74 65 |uivalent|-registe|
|00001c00| 72 20 63 68 61 69 6e 73 | 2e 20 20 48 6f 77 65 76 |r chains|. Howev|
|00001c10| 65 72 2c 20 74 68 65 20 | 76 65 63 74 6f 72 73 20 |er, the |vectors |
|00001c20| 60 72 65 67 5f 74 69 63 | 6b 27 0d 20 20 20 61 6e |`reg_tic|k'. an|
|00001c30| 64 20 60 72 65 67 5f 69 | 6e 5f 74 61 62 6c 65 27 |d `reg_i|n_table'|
|00001c40| 20 64 6f 20 6e 6f 74 20 | 61 70 70 6c 79 20 74 6f | do not |apply to|
|00001c50| 20 65 78 70 72 65 73 73 | 69 6f 6e 73 20 77 68 69 | express|ions whi|
|00001c60| 63 68 20 61 72 65 20 73 | 69 6d 70 6c 65 0d 20 20 |ch are s|imple. |
|00001c70| 20 72 65 67 69 73 74 65 | 72 20 72 65 66 65 72 65 | registe|r refere|
|00001c80| 6e 63 65 73 2e 20 20 54 | 68 65 73 65 20 65 78 70 |nces. T|hese exp|
|00001c90| 72 65 73 73 69 6f 6e 73 | 20 61 72 65 20 72 65 6d |ressions| are rem|
|00001ca0| 6f 76 65 64 20 66 72 6f | 6d 20 74 68 65 20 74 61 |oved fro|m the ta|
|00001cb0| 62 6c 65 0d 20 20 20 69 | 6d 6d 65 64 69 61 74 65 |ble. i|mmediate|
|00001cc0| 6c 79 20 77 68 65 6e 20 | 74 68 65 79 20 62 65 63 |ly when |they bec|
|00001cd0| 6f 6d 65 20 69 6e 76 61 | 6c 69 64 2c 20 61 6e 64 |ome inva|lid, and|
|00001ce0| 20 74 68 69 73 20 63 61 | 6e 20 62 65 20 64 6f 6e | this ca|n be don|
|00001cf0| 65 20 65 76 65 6e 20 69 | 66 0d 20 20 20 77 65 20 |e even i|f. we |
|00001d00| 64 6f 20 6e 6f 74 20 69 | 6d 6d 65 64 69 61 74 65 |do not i|mmediate|
|00001d10| 6c 79 20 73 65 61 72 63 | 68 20 66 6f 72 20 61 6c |ly searc|h for al|
|00001d20| 6c 20 74 68 65 20 65 78 | 70 72 65 73 73 69 6f 6e |l the ex|pression|
|00001d30| 73 20 74 68 61 74 20 72 | 65 66 65 72 20 74 6f 0d |s that r|efer to.|
|00001d40| 20 20 20 74 68 65 20 72 | 65 67 69 73 74 65 72 2e | the r|egister.|
|00001d50| 0d 0d 20 20 20 41 20 43 | 4c 4f 42 42 45 52 20 72 |.. A C|LOBBER r|
|00001d60| 74 78 20 69 6e 20 61 6e | 20 69 6e 73 74 72 75 63 |tx in an| instruc|
|00001d70| 74 69 6f 6e 20 69 6e 76 | 61 6c 69 64 61 74 65 73 |tion inv|alidates|
|00001d80| 20 69 74 73 20 6f 70 65 | 72 61 6e 64 20 66 6f 72 | its ope|rand for|
|00001d90| 20 66 75 72 74 68 65 72 | 0d 20 20 20 72 65 75 73 | further|. reus|
|00001da0| 65 2e 20 20 41 20 43 4c | 4f 42 42 45 52 20 6f 72 |e. A CL|OBBER or|
|00001db0| 20 53 45 54 20 72 74 78 | 20 77 68 6f 73 65 20 6f | SET rtx| whose o|
|00001dc0| 70 65 72 61 6e 64 20 69 | 73 20 61 20 4d 45 4d 3a |perand i|s a MEM:|
|00001dd0| 42 4c 4b 0d 20 20 20 69 | 6e 76 61 6c 69 64 61 74 |BLK. i|nvalidat|
|00001de0| 65 73 20 65 76 65 72 79 | 74 68 69 6e 67 20 74 68 |es every|thing th|
|00001df0| 61 74 20 72 65 73 69 64 | 65 73 20 69 6e 20 6d 65 |at resid|es in me|
|00001e00| 6d 6f 72 79 2e 0d 0d 52 | 65 6c 61 74 65 64 20 65 |mory...R|elated e|
|00001e10| 78 70 72 65 73 73 69 6f | 6e 73 3a 0d 0d 20 20 20 |xpressio|ns:.. |
|00001e20| 43 6f 6e 73 74 61 6e 74 | 20 65 78 70 72 65 73 73 |Constant| express|
|00001e30| 69 6f 6e 73 20 74 68 61 | 74 20 64 69 66 66 65 72 |ions tha|t differ|
|00001e40| 20 6f 6e 6c 79 20 62 79 | 20 61 6e 20 61 64 64 69 | only by| an addi|
|00001e50| 74 69 76 65 20 69 6e 74 | 65 67 65 72 0d 20 20 20 |tive int|eger. |
|00001e60| 61 72 65 20 63 61 6c 6c | 65 64 20 72 65 6c 61 74 |are call|ed relat|
|00001e70| 65 64 2e 20 20 57 68 65 | 6e 20 61 20 63 6f 6e 73 |ed. Whe|n a cons|
|00001e80| 74 61 6e 74 20 65 78 70 | 72 65 73 73 69 6f 6e 20 |tant exp|ression |
|00001e90| 69 73 20 70 75 74 20 69 | 6e 0d 20 20 20 74 68 65 |is put i|n. the|
|00001ea0| 20 74 61 62 6c 65 2c 20 | 74 68 65 20 72 65 6c 61 | table, |the rela|
|00001eb0| 74 65 64 20 65 78 70 72 | 65 73 73 69 6f 6e 20 77 |ted expr|ession w|
|00001ec0| 69 74 68 20 6e 6f 20 63 | 6f 6e 73 74 61 6e 74 20 |ith no c|onstant |
|00001ed0| 74 65 72 6d 0d 20 20 20 | 69 73 20 61 6c 73 6f 20 |term. |is also |
|00001ee0| 65 6e 74 65 72 65 64 2e | 20 20 54 68 65 73 65 20 |entered.| These |
|00001ef0| 61 72 65 20 6d 61 64 65 | 20 74 6f 20 70 6f 69 6e |are made| to poin|
|00001f00| 74 20 61 74 20 65 61 63 | 68 20 6f 74 68 65 72 0d |t at eac|h other.|
|00001f10| 20 20 20 73 6f 20 74 68 | 61 74 20 69 74 20 69 73 | so th|at it is|
|00001f20| 20 70 6f 73 73 69 62 6c | 65 20 74 6f 20 66 69 6e | possibl|e to fin|
|00001f30| 64 20 6f 75 74 20 69 66 | 20 74 68 65 72 65 20 65 |d out if| there e|
|00001f40| 78 69 73 74 73 20 61 6e | 79 0d 20 20 20 72 65 67 |xists an|y. reg|
|00001f50| 69 73 74 65 72 20 65 71 | 75 69 76 61 6c 65 6e 74 |ister eq|uivalent|
|00001f60| 20 74 6f 20 61 6e 20 65 | 78 70 72 65 73 73 69 6f | to an e|xpressio|
|00001f70| 6e 20 72 65 6c 61 74 65 | 64 20 74 6f 20 61 20 67 |n relate|d to a g|
|00001f80| 69 76 65 6e 20 65 78 70 | 72 65 73 73 69 6f 6e 2e |iven exp|ression.|
|00001f90| 20 20 2a 2f 0d 20 20 20 | 0d 2f 2a 20 4f 6e 65 20 | */. |./* One |
|00001fa0| 70 6c 75 73 20 6c 61 72 | 67 65 73 74 20 72 65 67 |plus lar|gest reg|
|00001fb0| 69 73 74 65 72 20 6e 75 | 6d 62 65 72 20 75 73 65 |ister nu|mber use|
|00001fc0| 64 20 69 6e 20 74 68 69 | 73 20 66 75 6e 63 74 69 |d in thi|s functi|
|00001fd0| 6f 6e 2e 20 20 2a 2f 0d | 0d 73 74 61 74 69 63 20 |on. */.|.static |
|00001fe0| 69 6e 74 20 6d 61 78 5f | 72 65 67 3b 0d 0d 2f 2a |int max_|reg;../*|
|00001ff0| 20 4c 65 6e 67 74 68 20 | 6f 66 20 76 65 63 74 6f | Length |of vecto|
|00002000| 72 73 20 69 6e 64 65 78 | 65 64 20 62 79 20 71 75 |rs index|ed by qu|
|00002010| 61 6e 74 69 74 79 20 6e | 75 6d 62 65 72 2e 0d 20 |antity n|umber.. |
|00002020| 20 20 57 65 20 6b 6e 6f | 77 20 69 6e 20 61 64 76 | We kno|w in adv|
|00002030| 61 6e 63 65 20 77 65 20 | 77 69 6c 6c 20 6e 6f 74 |ance we |will not|
|00002040| 20 6e 65 65 64 20 61 20 | 71 75 61 6e 74 69 74 79 | need a |quantity|
|00002050| 20 6e 75 6d 62 65 72 20 | 74 68 69 73 20 62 69 67 | number |this big|
|00002060| 2e 20 20 2a 2f 0d 0d 73 | 74 61 74 69 63 20 69 6e |. */..s|tatic in|
|00002070| 74 20 6d 61 78 5f 71 74 | 79 3b 0d 0d 2f 2a 20 4e |t max_qt|y;../* N|
|00002080| 65 78 74 20 71 75 61 6e | 74 69 74 79 20 6e 75 6d |ext quan|tity num|
|00002090| 62 65 72 20 74 6f 20 62 | 65 20 61 6c 6c 6f 63 61 |ber to b|e alloca|
|000020a0| 74 65 64 2e 0d 20 20 20 | 54 68 69 73 20 69 73 20 |ted.. |This is |
|000020b0| 31 20 2b 20 74 68 65 20 | 6c 61 72 67 65 73 74 20 |1 + the |largest |
|000020c0| 6e 75 6d 62 65 72 20 6e | 65 65 64 65 64 20 73 6f |number n|eeded so|
|000020d0| 20 66 61 72 2e 20 20 2a | 2f 0d 0d 73 74 61 74 69 | far. *|/..stati|
|000020e0| 63 20 69 6e 74 20 6e 65 | 78 74 5f 71 74 79 3b 0d |c int ne|xt_qty;.|
|000020f0| 0d 2f 2a 20 49 6e 64 65 | 78 65 64 20 62 79 20 71 |./* Inde|xed by q|
|00002100| 75 61 6e 74 69 74 79 20 | 6e 75 6d 62 65 72 2c 20 |uantity |number, |
|00002110| 67 69 76 65 73 20 74 68 | 65 20 66 69 72 73 74 20 |gives th|e first |
|00002120| 28 6f 72 20 6c 61 73 74 | 29 20 28 70 73 65 75 64 |(or last|) (pseud|
|00002130| 6f 29 20 72 65 67 69 73 | 74 65 72 20 0d 20 20 20 |o) regis|ter . |
|00002140| 69 6e 20 74 68 65 20 63 | 68 61 69 6e 20 6f 66 20 |in the c|hain of |
|00002150| 72 65 67 69 73 74 65 72 | 73 20 74 68 61 74 20 63 |register|s that c|
|00002160| 75 72 72 65 6e 74 6c 79 | 20 63 6f 6e 74 61 69 6e |urrently| contain|
|00002170| 20 74 68 69 73 20 71 75 | 61 6e 74 69 74 79 2e 20 | this qu|antity. |
|00002180| 20 2a 2f 0d 0d 73 74 61 | 74 69 63 20 69 6e 74 20 | */..sta|tic int |
|00002190| 2a 71 74 79 5f 66 69 72 | 73 74 5f 72 65 67 3b 0d |*qty_fir|st_reg;.|
|000021a0| 73 74 61 74 69 63 20 69 | 6e 74 20 2a 71 74 79 5f |static i|nt *qty_|
|000021b0| 6c 61 73 74 5f 72 65 67 | 3b 0d 0d 2f 2a 20 49 6e |last_reg|;../* In|
|000021c0| 64 65 78 65 64 20 62 79 | 20 71 75 61 6e 74 69 74 |dexed by| quantit|
|000021d0| 79 20 6e 75 6d 62 65 72 | 2c 20 67 69 76 65 73 20 |y number|, gives |
|000021e0| 74 68 65 20 72 74 78 20 | 6f 66 20 74 68 65 20 63 |the rtx |of the c|
|000021f0| 6f 6e 73 74 61 6e 74 20 | 76 61 6c 75 65 20 6f 66 |onstant |value of|
|00002200| 20 74 68 65 0d 20 20 20 | 71 75 61 6e 74 69 74 79 | the. |quantity|
|00002210| 2c 20 6f 72 20 7a 65 72 | 6f 20 69 66 20 69 74 20 |, or zer|o if it |
|00002220| 64 6f 65 73 20 6e 6f 74 | 20 68 61 76 65 20 61 20 |does not| have a |
|00002230| 6b 6e 6f 77 6e 20 76 61 | 6c 75 65 2e 0d 20 20 20 |known va|lue.. |
|00002240| 41 20 73 75 6d 20 6f 66 | 20 74 68 65 20 66 72 61 |A sum of| the fra|
|00002250| 6d 65 20 70 6f 69 6e 74 | 65 72 20 28 6f 72 20 61 |me point|er (or a|
|00002260| 72 67 20 70 6f 69 6e 74 | 65 72 29 20 70 6c 75 73 |rg point|er) plus|
|00002270| 20 61 20 63 6f 6e 73 74 | 61 6e 74 0d 20 20 20 63 | a const|ant. c|
|00002280| 61 6e 20 61 6c 73 6f 20 | 62 65 20 65 6e 74 65 72 |an also |be enter|
|00002290| 65 64 20 68 65 72 65 2e | 20 20 2a 2f 0d 0d 73 74 |ed here.| */..st|
|000022a0| 61 74 69 63 20 72 74 78 | 20 2a 71 74 79 5f 63 6f |atic rtx| *qty_co|
|000022b0| 6e 73 74 3b 0d 0d 2f 2a | 20 49 6e 64 65 78 65 64 |nst;../*| Indexed|
|000022c0| 20 62 79 20 71 74 79 20 | 6e 75 6d 62 65 72 2c 20 | by qty |number, |
|000022d0| 67 69 76 65 73 20 74 68 | 65 20 69 6e 73 6e 20 74 |gives th|e insn t|
|000022e0| 68 61 74 20 73 74 6f 72 | 65 64 20 74 68 65 20 63 |hat stor|ed the c|
|000022f0| 6f 6e 73 74 61 6e 74 20 | 76 61 6c 75 65 0d 20 20 |onstant |value. |
|00002300| 20 72 65 63 6f 72 64 65 | 64 20 69 6e 20 60 71 74 | recorde|d in `qt|
|00002310| 79 5f 63 6f 6e 73 74 27 | 2e 20 20 2a 2f 0d 0d 73 |y_const'|. */..s|
|00002320| 74 61 74 69 63 20 72 74 | 78 20 2a 71 74 79 5f 63 |tatic rt|x *qty_c|
|00002330| 6f 6e 73 74 5f 69 6e 73 | 6e 3b 0d 0d 2f 2a 20 56 |onst_ins|n;../* V|
|00002340| 61 6c 75 65 20 73 74 6f | 72 65 64 20 69 6e 20 43 |alue sto|red in C|
|00002350| 43 30 20 62 79 20 70 72 | 65 76 69 6f 75 73 20 69 |C0 by pr|evious i|
|00002360| 6e 73 6e 3a 0d 20 20 20 | 30 20 69 66 20 70 72 65 |nsn:. |0 if pre|
|00002370| 76 69 6f 75 73 20 69 6e | 73 6e 20 64 69 64 6e 27 |vious in|sn didn'|
|00002380| 74 20 73 74 6f 72 65 20 | 69 6e 20 43 43 30 2e 0d |t store |in CC0..|
|00002390| 20 20 20 65 6c 73 65 20 | 30 31 30 30 20 2b 20 28 | else |0100 + (|
|000023a0| 4d 26 37 29 3c 3c 33 20 | 2b 20 28 4e 26 37 29 0d |M&7)<<3 |+ (N&7).|
|000023b0| 20 20 20 77 68 65 72 65 | 20 4d 20 69 73 20 31 2c | where| M is 1,|
|000023c0| 20 30 20 6f 72 20 2d 31 | 20 69 66 20 72 65 73 75 | 0 or -1| if resu|
|000023d0| 6c 74 20 77 61 73 20 3e | 2c 20 3d 3d 20 6f 72 20 |lt was >|, == or |
|000023e0| 3c 20 61 73 20 73 69 67 | 6e 65 64 20 6e 75 6d 62 |< as sig|ned numb|
|000023f0| 65 72 0d 20 20 20 61 6e | 64 20 4e 20 69 73 20 31 |er. an|d N is 1|
|00002400| 2c 20 30 20 6f 72 20 2d | 31 20 69 66 20 72 65 73 |, 0 or -|1 if res|
|00002410| 75 6c 74 20 77 61 73 20 | 3e 2c 20 3d 3d 20 6f 72 |ult was |>, == or|
|00002420| 20 3c 20 61 73 20 75 6e | 73 69 67 6e 65 64 20 6e | < as un|signed n|
|00002430| 75 6d 62 65 72 2e 0d 20 | 20 20 30 32 30 30 20 62 |umber.. | 0200 b|
|00002440| 69 74 20 6d 61 79 20 61 | 6c 73 6f 20 62 65 20 73 |it may a|lso be s|
|00002450| 65 74 2c 20 6d 65 61 6e | 69 6e 67 20 74 68 61 74 |et, mean|ing that|
|00002460| 20 6f 6e 6c 79 20 3d 3d | 20 61 6e 64 20 21 3d 20 | only ==| and != |
|00002470| 63 6f 6d 70 61 72 69 73 | 6f 6e 73 0d 20 20 20 68 |comparis|ons. h|
|00002480| 61 76 65 20 6b 6e 6f 77 | 6e 20 72 65 73 75 6c 74 |ave know|n result|
|00002490| 73 2e 20 20 2a 2f 0d 0d | 73 74 61 74 69 63 20 69 |s. */..|static i|
|000024a0| 6e 74 20 70 72 65 76 5f | 69 6e 73 6e 5f 63 63 30 |nt prev_|insn_cc0|
|000024b0| 3b 0d 0d 2f 2a 20 46 6f | 72 20 6d 61 63 68 69 6e |;../* Fo|r machin|
|000024c0| 65 73 20 77 68 65 72 65 | 20 43 43 30 20 69 73 20 |es where| CC0 is |
|000024d0| 6f 6e 65 20 62 69 74 2c | 20 77 65 20 6d 61 79 20 |one bit,| we may |
|000024e0| 73 65 65 20 43 43 30 20 | 61 73 73 69 67 6e 65 64 |see CC0 |assigned|
|000024f0| 20 61 0d 20 20 20 63 6f | 6e 73 74 61 6e 74 20 76 | a. co|nstant v|
|00002500| 61 6c 75 65 20 28 61 66 | 74 65 72 20 66 6f 6c 64 |alue (af|ter fold|
|00002510| 5f 72 74 78 29 2e 0d 20 | 20 20 52 65 63 6f 72 64 |_rtx).. | Record|
|00002520| 20 68 65 72 65 20 74 68 | 65 20 76 61 6c 75 65 20 | here th|e value |
|00002530| 73 74 6f 72 65 64 20 69 | 6e 20 74 68 65 20 70 72 |stored i|n the pr|
|00002540| 65 76 69 6f 75 73 20 69 | 6e 73 6e 20 28 30 20 69 |evious i|nsn (0 i|
|00002550| 66 20 6e 6f 6e 65 29 2e | 20 20 2a 2f 0d 0d 73 74 |f none).| */..st|
|00002560| 61 74 69 63 20 72 74 78 | 20 70 72 65 76 5f 69 6e |atic rtx| prev_in|
|00002570| 73 6e 5f 65 78 70 6c 69 | 63 69 74 5f 63 63 30 3b |sn_expli|cit_cc0;|
|00002580| 0d 0d 2f 2a 20 50 72 65 | 76 69 6f 75 73 20 61 63 |../* Pre|vious ac|
|00002590| 74 75 61 6c 20 69 6e 73 | 6e 2e 20 20 30 20 69 66 |tual ins|n. 0 if|
|000025a0| 20 61 74 20 66 69 72 73 | 74 20 69 6e 73 6e 20 6f | at firs|t insn o|
|000025b0| 66 20 62 61 73 69 63 20 | 62 6c 6f 63 6b 2e 20 20 |f basic |block. |
|000025c0| 2a 2f 0d 0d 73 74 61 74 | 69 63 20 72 74 78 20 70 |*/..stat|ic rtx p|
|000025d0| 72 65 76 5f 69 6e 73 6e | 3b 0d 0d 2f 2a 20 49 6e |rev_insn|;../* In|
|000025e0| 73 6e 20 62 65 69 6e 67 | 20 73 63 61 6e 6e 65 64 |sn being| scanned|
|000025f0| 2e 20 20 2a 2f 0d 0d 73 | 74 61 74 69 63 20 72 74 |. */..s|tatic rt|
|00002600| 78 20 74 68 69 73 5f 69 | 6e 73 6e 3b 0d 0d 2f 2a |x this_i|nsn;../*|
|00002610| 20 49 6e 64 65 78 20 62 | 79 20 28 70 73 65 75 64 | Index b|y (pseud|
|00002620| 6f 29 20 72 65 67 69 73 | 74 65 72 20 6e 75 6d 62 |o) regis|ter numb|
|00002630| 65 72 2c 20 67 69 76 65 | 73 20 74 68 65 20 71 75 |er, give|s the qu|
|00002640| 61 6e 74 69 74 79 20 6e | 75 6d 62 65 72 0d 20 20 |antity n|umber. |
|00002650| 20 6f 66 20 74 68 65 20 | 72 65 67 69 73 74 65 72 | of the |register|
|00002660| 27 73 20 63 75 72 72 65 | 6e 74 20 63 6f 6e 74 65 |'s curre|nt conte|
|00002670| 6e 74 73 2e 20 20 2a 2f | 0d 0d 73 74 61 74 69 63 |nts. */|..static|
|00002680| 20 69 6e 74 20 2a 72 65 | 67 5f 71 74 79 3b 0d 0d | int *re|g_qty;..|
|00002690| 2f 2a 20 49 6e 64 65 78 | 20 62 79 20 28 70 73 65 |/* Index| by (pse|
|000026a0| 75 64 6f 29 20 72 65 67 | 69 73 74 65 72 20 6e 75 |udo) reg|ister nu|
|000026b0| 6d 62 65 72 2c 20 67 69 | 76 65 73 20 74 68 65 20 |mber, gi|ves the |
|000026c0| 6e 75 6d 62 65 72 20 6f | 66 20 74 68 65 20 6e 65 |number o|f the ne|
|000026d0| 78 74 0d 20 20 20 28 70 | 73 65 75 64 6f 29 20 72 |xt. (p|seudo) r|
|000026e0| 65 67 69 73 74 65 72 20 | 69 6e 20 74 68 65 20 63 |egister |in the c|
|000026f0| 68 61 69 6e 20 6f 66 20 | 72 65 67 69 73 74 65 72 |hain of |register|
|00002700| 73 20 73 68 61 72 69 6e | 67 20 74 68 65 20 73 61 |s sharin|g the sa|
|00002710| 6d 65 20 76 61 6c 75 65 | 2e 0d 20 20 20 4f 72 20 |me value|.. Or |
|00002720| 2d 31 20 69 66 20 74 68 | 69 73 20 72 65 67 69 73 |-1 if th|is regis|
|00002730| 74 65 72 20 69 73 20 61 | 74 20 74 68 65 20 65 6e |ter is a|t the en|
|00002740| 64 20 6f 66 20 74 68 65 | 20 63 68 61 69 6e 2e 20 |d of the| chain. |
|00002750| 20 2a 2f 0d 0d 73 74 61 | 74 69 63 20 69 6e 74 20 | */..sta|tic int |
|00002760| 2a 72 65 67 5f 6e 65 78 | 74 5f 65 71 76 3b 0d 0d |*reg_nex|t_eqv;..|
|00002770| 2f 2a 20 49 6e 64 65 78 | 20 62 79 20 28 70 73 65 |/* Index| by (pse|
|00002780| 75 64 6f 29 20 72 65 67 | 69 73 74 65 72 20 6e 75 |udo) reg|ister nu|
|00002790| 6d 62 65 72 2c 20 67 69 | 76 65 73 20 74 68 65 20 |mber, gi|ves the |
|000027a0| 6e 75 6d 62 65 72 20 6f | 66 20 74 68 65 20 70 72 |number o|f the pr|
|000027b0| 65 76 69 6f 75 73 0d 20 | 20 20 28 70 73 65 75 64 |evious. | (pseud|
|000027c0| 6f 29 20 72 65 67 69 73 | 74 65 72 20 69 6e 20 74 |o) regis|ter in t|
|000027d0| 68 65 20 63 68 61 69 6e | 20 6f 66 20 72 65 67 69 |he chain| of regi|
|000027e0| 73 74 65 72 73 20 73 68 | 61 72 69 6e 67 20 74 68 |sters sh|aring th|
|000027f0| 65 20 73 61 6d 65 20 76 | 61 6c 75 65 2e 0d 20 20 |e same v|alue.. |
|00002800| 20 4f 72 20 2d 31 20 69 | 66 20 74 68 69 73 20 72 | Or -1 i|f this r|
|00002810| 65 67 69 73 74 65 72 20 | 69 73 20 61 74 20 74 68 |egister |is at th|
|00002820| 65 20 62 65 67 69 6e 6e | 69 6e 67 20 6f 66 20 74 |e beginn|ing of t|
|00002830| 68 65 20 63 68 61 69 6e | 2e 20 20 2a 2f 0d 0d 73 |he chain|. */..s|
|00002840| 74 61 74 69 63 20 69 6e | 74 20 2a 72 65 67 5f 70 |tatic in|t *reg_p|
|00002850| 72 65 76 5f 65 71 76 3b | 0d 0d 2f 2a 20 49 6e 64 |rev_eqv;|../* Ind|
|00002860| 65 78 20 62 79 20 28 70 | 73 65 75 64 6f 29 20 72 |ex by (p|seudo) r|
|00002870| 65 67 69 73 74 65 72 20 | 6e 75 6d 62 65 72 2c 20 |egister |number, |
|00002880| 67 69 76 65 73 20 74 68 | 65 20 6c 61 74 65 73 74 |gives th|e latest|
|00002890| 20 72 74 78 0d 20 20 20 | 74 6f 20 75 73 65 20 74 | rtx. |to use t|
|000028a0| 6f 20 69 6e 73 65 72 74 | 20 61 20 72 65 66 20 74 |o insert| a ref t|
|000028b0| 6f 20 74 68 61 74 20 72 | 65 67 69 73 74 65 72 2e |o that r|egister.|
|000028c0| 20 20 2a 2f 0d 0d 73 74 | 61 74 69 63 20 72 74 78 | */..st|atic rtx|
|000028d0| 20 2a 72 65 67 5f 72 74 | 78 3b 0d 0d 2f 2a 20 49 | *reg_rt|x;../* I|
|000028e0| 6e 64 65 78 20 62 79 20 | 28 70 73 65 75 64 6f 29 |ndex by |(pseudo)|
|000028f0| 20 72 65 67 69 73 74 65 | 72 20 6e 75 6d 62 65 72 | registe|r number|
|00002900| 2c 20 67 69 76 65 73 20 | 74 68 65 20 6e 75 6d 62 |, gives |the numb|
|00002910| 65 72 20 6f 66 20 74 69 | 6d 65 73 0d 20 20 20 74 |er of ti|mes. t|
|00002920| 68 61 74 20 72 65 67 69 | 73 74 65 72 20 68 61 73 |hat regi|ster has|
|00002930| 20 62 65 65 6e 20 61 6c | 74 65 72 65 64 20 69 6e | been al|tered in|
|00002940| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 62 61 73 | the cur|rent bas|
|00002950| 69 63 20 62 6c 6f 63 6b | 2e 20 20 2a 2f 0d 0d 73 |ic block|. */..s|
|00002960| 74 61 74 69 63 20 69 6e | 74 20 2a 72 65 67 5f 74 |tatic in|t *reg_t|
|00002970| 69 63 6b 3b 0d 0d 2f 2a | 20 49 6e 64 65 78 20 62 |ick;../*| Index b|
|00002980| 79 20 28 70 73 65 75 64 | 6f 29 20 72 65 67 69 73 |y (pseud|o) regis|
|00002990| 74 65 72 20 6e 75 6d 62 | 65 72 2c 20 67 69 76 65 |ter numb|er, give|
|000029a0| 73 20 74 68 65 20 72 65 | 67 5f 74 69 63 6b 20 76 |s the re|g_tick v|
|000029b0| 61 6c 75 65 20 61 74 20 | 77 68 69 63 68 0d 20 20 |alue at |which. |
|000029c0| 20 72 74 78 27 73 20 63 | 6f 6e 74 61 69 6e 69 6e | rtx's c|ontainin|
|000029d0| 67 20 74 68 69 73 20 72 | 65 67 69 73 74 65 72 20 |g this r|egister |
|000029e0| 61 72 65 20 76 61 6c 69 | 64 20 69 6e 20 74 68 65 |are vali|d in the|
|000029f0| 20 68 61 73 68 20 74 61 | 62 6c 65 2e 0d 20 20 20 | hash ta|ble.. |
|00002a00| 49 66 20 74 68 69 73 20 | 64 6f 65 73 20 6e 6f 74 |If this |does not|
|00002a10| 20 65 71 75 61 6c 20 74 | 68 65 20 63 75 72 72 65 | equal t|he curre|
|00002a20| 6e 74 20 72 65 67 5f 74 | 69 63 6b 20 76 61 6c 75 |nt reg_t|ick valu|
|00002a30| 65 2c 20 73 75 63 68 20 | 65 78 70 72 65 73 73 69 |e, such |expressi|
|00002a40| 6f 6e 73 0d 20 20 20 65 | 78 69 73 74 69 6e 67 20 |ons. e|xisting |
|00002a50| 69 6e 20 74 68 65 20 68 | 61 73 68 20 74 61 62 6c |in the h|ash tabl|
|00002a60| 65 20 61 72 65 20 69 6e | 76 61 6c 69 64 2e 0d 20 |e are in|valid.. |
|00002a70| 20 20 49 66 20 74 68 69 | 73 20 69 73 20 2d 31 2c | If thi|s is -1,|
|00002a80| 20 6e 6f 20 65 78 70 72 | 65 73 73 69 6f 6e 73 20 | no expr|essions |
|00002a90| 63 6f 6e 74 61 69 6e 69 | 6e 67 20 74 68 69 73 20 |containi|ng this |
|00002aa0| 72 65 67 69 73 74 65 72 | 20 68 61 76 65 20 62 65 |register| have be|
|00002ab0| 65 6e 0d 20 20 20 65 6e | 74 65 72 65 64 20 69 6e |en. en|tered in|
|00002ac0| 20 74 68 65 20 74 61 62 | 6c 65 2e 20 20 2a 2f 0d | the tab|le. */.|
|00002ad0| 0d 73 74 61 74 69 63 20 | 69 6e 74 20 2a 72 65 67 |.static |int *reg|
|00002ae0| 5f 69 6e 5f 74 61 62 6c | 65 3b 0d 0d 2f 2a 20 54 |_in_tabl|e;../* T|
|00002af0| 77 6f 20 76 65 63 74 6f | 72 73 20 6f 66 20 6d 61 |wo vecto|rs of ma|
|00002b00| 78 5f 72 65 67 20 69 6e | 74 73 3a 0d 20 20 20 6f |x_reg in|ts:. o|
|00002b10| 6e 65 20 63 6f 6e 74 61 | 69 6e 69 6e 67 20 61 6c |ne conta|ining al|
|00002b20| 6c 20 2d 31 27 73 3b 20 | 69 6e 20 74 68 65 20 6f |l -1's; |in the o|
|00002b30| 74 68 65 72 2c 20 65 6c | 65 6d 65 6e 74 20 69 20 |ther, el|ement i |
|00002b40| 63 6f 6e 74 61 69 6e 73 | 20 69 2e 0d 20 20 20 54 |contains| i.. T|
|00002b50| 68 65 73 65 20 61 72 65 | 20 75 73 65 64 20 74 6f |hese are| used to|
|00002b60| 20 69 6e 69 74 69 61 6c | 69 7a 65 20 76 61 72 69 | initial|ize vari|
|00002b70| 6f 75 73 20 6f 74 68 65 | 72 20 76 65 63 74 6f 72 |ous othe|r vector|
|00002b80| 73 20 66 61 73 74 2e 20 | 20 2a 2f 0d 0d 73 74 61 |s fast. | */..sta|
|00002b90| 74 69 63 20 69 6e 74 20 | 2a 61 6c 6c 5f 6d 69 6e |tic int |*all_min|
|00002ba0| 75 73 5f 6f 6e 65 3b 0d | 73 74 61 74 69 63 20 69 |us_one;.|static i|
|00002bb0| 6e 74 20 2a 63 6f 6e 73 | 65 63 5f 69 6e 74 73 3b |nt *cons|ec_ints;|
|00002bc0| 0d 0d 2f 2a 20 53 65 74 | 20 6e 6f 6e 7a 65 72 6f |../* Set| nonzero|
|00002bd0| 20 69 6e 20 63 73 65 5f | 69 6e 73 6e 20 74 6f 20 | in cse_|insn to |
|00002be0| 74 65 6c 6c 20 63 73 65 | 5f 62 61 73 69 63 5f 62 |tell cse|_basic_b|
|00002bf0| 6c 6f 63 6b 20 74 6f 20 | 73 6b 69 70 20 69 6d 6d |lock to |skip imm|
|00002c00| 65 64 69 61 74 65 6c 79 | 0d 20 20 20 74 6f 20 74 |ediately|. to t|
|00002c10| 68 65 20 6e 65 78 74 20 | 62 61 73 69 63 20 62 6c |he next |basic bl|
|00002c20| 6f 63 6b 20 61 6e 64 20 | 74 72 65 61 74 20 69 74 |ock and |treat it|
|00002c30| 20 61 73 20 61 20 63 6f | 6e 74 69 6e 75 61 74 69 | as a co|ntinuati|
|00002c40| 6f 6e 20 6f 66 20 74 68 | 69 73 20 6f 6e 65 2e 20 |on of th|is one. |
|00002c50| 20 2a 2f 0d 0d 73 74 61 | 74 69 63 20 69 6e 74 20 | */..sta|tic int |
|00002c60| 63 73 65 5f 73 6b 69 70 | 5f 74 6f 5f 6e 65 78 74 |cse_skip|_to_next|
|00002c70| 5f 62 6c 6f 63 6b 3b 0d | 0d 2f 2a 20 43 55 49 44 |_block;.|./* CUID|
|00002c80| 20 6f 66 20 69 6e 73 6e | 20 74 68 61 74 20 73 74 | of insn| that st|
|00002c90| 61 72 74 73 20 74 68 65 | 20 62 61 73 69 63 20 62 |arts the| basic b|
|00002ca0| 6c 6f 63 6b 20 63 75 72 | 72 65 6e 74 6c 79 20 62 |lock cur|rently b|
|00002cb0| 65 69 6e 67 20 63 73 65 | 2d 70 72 6f 63 65 73 73 |eing cse|-process|
|00002cc0| 65 64 2e 20 20 2a 2f 0d | 0d 73 74 61 74 69 63 20 |ed. */.|.static |
|00002cd0| 69 6e 74 20 63 73 65 5f | 62 61 73 69 63 5f 62 6c |int cse_|basic_bl|
|00002ce0| 6f 63 6b 5f 73 74 61 72 | 74 3b 0d 0d 2f 2a 20 43 |ock_star|t;../* C|
|00002cf0| 55 49 44 20 6f 66 20 69 | 6e 73 6e 20 74 68 61 74 |UID of i|nsn that|
|00002d00| 20 65 6e 64 73 20 74 68 | 65 20 62 61 73 69 63 20 | ends th|e basic |
|00002d10| 62 6c 6f 63 6b 20 63 75 | 72 72 65 6e 74 6c 79 20 |block cu|rrently |
|00002d20| 62 65 69 6e 67 20 63 73 | 65 2d 70 72 6f 63 65 73 |being cs|e-proces|
|00002d30| 73 65 64 2e 20 20 2a 2f | 0d 0d 73 74 61 74 69 63 |sed. */|..static|
|00002d40| 20 69 6e 74 20 63 73 65 | 5f 62 61 73 69 63 5f 62 | int cse|_basic_b|
|00002d50| 6c 6f 63 6b 5f 65 6e 64 | 3b 0d 0d 2f 2a 20 56 65 |lock_end|;../* Ve|
|00002d60| 63 74 6f 72 20 6d 61 70 | 70 69 6e 67 20 49 4e 53 |ctor map|ping INS|
|00002d70| 4e 5f 55 49 44 73 20 74 | 6f 20 63 75 69 64 73 2e |N_UIDs t|o cuids.|
|00002d80| 0d 20 20 20 54 68 65 20 | 63 75 69 64 73 20 61 72 |. The |cuids ar|
|00002d90| 65 20 6c 69 6b 65 20 75 | 69 64 73 20 62 75 74 20 |e like u|ids but |
|00002da0| 69 6e 63 72 65 61 73 65 | 20 6d 6f 6e 6f 6e 6f 6e |increase| mononon|
|00002db0| 69 63 61 6c 6c 79 20 61 | 6c 77 61 79 73 2e 0d 20 |ically a|lways.. |
|00002dc0| 20 20 57 65 20 75 73 65 | 20 74 68 65 6d 20 74 6f | We use| them to|
|00002dd0| 20 73 65 65 20 77 68 65 | 74 68 65 72 20 61 20 72 | see whe|ther a r|
|00002de0| 65 67 20 69 73 20 75 73 | 65 64 20 6f 75 74 73 69 |eg is us|ed outsi|
|00002df0| 64 65 20 61 20 67 69 76 | 65 6e 20 62 61 73 69 63 |de a giv|en basic|
|00002e00| 20 62 6c 6f 63 6b 2e 20 | 20 2a 2f 0d 0d 73 74 61 | block. | */..sta|
|00002e10| 74 69 63 20 73 68 6f 72 | 74 20 2a 75 69 64 5f 63 |tic shor|t *uid_c|
|00002e20| 75 69 64 3b 0d 0d 2f 2a | 20 47 65 74 20 74 68 65 |uid;../*| Get the|
|00002e30| 20 63 75 69 64 20 6f 66 | 20 61 6e 20 69 6e 73 6e | cuid of| an insn|
|00002e40| 2e 20 20 2a 2f 0d 0d 23 | 64 65 66 69 6e 65 20 49 |. */..#|define I|
|00002e50| 4e 53 4e 5f 43 55 49 44 | 28 49 4e 53 4e 29 20 28 |NSN_CUID|(INSN) (|
|00002e60| 75 69 64 5f 63 75 69 64 | 5b 49 4e 53 4e 5f 55 49 |uid_cuid|[INSN_UI|
|00002e70| 44 20 28 49 4e 53 4e 29 | 5d 29 0d 0d 2f 2a 20 4e |D (INSN)|])../* N|
|00002e80| 6f 6e 7a 65 72 6f 20 69 | 66 20 63 73 65 20 68 61 |onzero i|f cse ha|
|00002e90| 73 20 61 6c 74 65 72 65 | 64 20 63 6f 6e 64 69 74 |s altere|d condit|
|00002ea0| 69 6f 6e 61 6c 20 6a 75 | 6d 70 20 69 6e 73 6e 73 |ional ju|mp insns|
|00002eb0| 0d 20 20 20 69 6e 20 73 | 75 63 68 20 61 20 77 61 |. in s|uch a wa|
|00002ec0| 79 20 74 68 61 74 20 6a | 75 6d 70 20 6f 70 74 69 |y that j|ump opti|
|00002ed0| 6d 69 7a 61 74 69 6f 6e | 20 73 68 6f 75 6c 64 20 |mization| should |
|00002ee0| 62 65 20 72 65 64 6f 6e | 65 2e 20 20 2a 2f 0d 0d |be redon|e. */..|
|00002ef0| 73 74 61 74 69 63 20 69 | 6e 74 20 63 73 65 5f 6a |static i|nt cse_j|
|00002f00| 75 6d 70 73 5f 61 6c 74 | 65 72 65 64 3b 0d 0d 2f |umps_alt|ered;../|
|00002f10| 2a 20 63 61 6e 6f 6e 5f | 68 61 73 68 20 73 74 6f |* canon_|hash sto|
|00002f20| 72 65 73 20 31 20 69 6e | 20 64 6f 5f 6e 6f 74 5f |res 1 in| do_not_|
|00002f30| 72 65 63 6f 72 64 0d 20 | 20 20 69 66 20 69 74 20 |record. | if it |
|00002f40| 6e 6f 74 69 63 65 73 20 | 61 20 72 65 66 65 72 65 |notices |a refere|
|00002f50| 6e 63 65 20 74 6f 20 43 | 43 30 2c 20 43 43 31 20 |nce to C|C0, CC1 |
|00002f60| 6f 72 20 50 43 2e 20 20 | 2a 2f 0d 0d 73 74 61 74 |or PC. |*/..stat|
|00002f70| 69 63 20 69 6e 74 20 64 | 6f 5f 6e 6f 74 5f 72 65 |ic int d|o_not_re|
|00002f80| 63 6f 72 64 3b 0d 0d 2f | 2a 20 63 61 6e 6f 6e 5f |cord;../|* canon_|
|00002f90| 68 61 73 68 20 73 74 6f | 72 65 73 20 31 20 69 6e |hash sto|res 1 in|
|00002fa0| 20 68 61 73 68 5f 61 72 | 67 5f 69 6e 5f 6d 65 6d | hash_ar|g_in_mem|
|00002fb0| 6f 72 79 0d 20 20 20 69 | 66 20 69 74 20 6e 6f 74 |ory. i|f it not|
|00002fc0| 69 63 65 73 20 61 20 72 | 65 66 65 72 65 6e 63 65 |ices a r|eference|
|00002fd0| 20 74 6f 20 6d 65 6d 6f | 72 79 20 77 69 74 68 69 | to memo|ry withi|
|00002fe0| 6e 20 74 68 65 20 65 78 | 70 72 65 73 73 69 6f 6e |n the ex|pression|
|00002ff0| 20 62 65 69 6e 67 20 68 | 61 73 68 65 64 2e 20 20 | being h|ashed. |
|00003000| 2a 2f 0d 0d 73 74 61 74 | 69 63 20 69 6e 74 20 68 |*/..stat|ic int h|
|00003010| 61 73 68 5f 61 72 67 5f | 69 6e 5f 6d 65 6d 6f 72 |ash_arg_|in_memor|
|00003020| 79 3b 0d 0d 2f 2a 20 63 | 61 6e 6f 6e 5f 68 61 73 |y;../* c|anon_has|
|00003030| 68 20 73 74 6f 72 65 73 | 20 31 20 69 6e 20 68 61 |h stores| 1 in ha|
|00003040| 73 68 5f 61 72 67 5f 69 | 6e 5f 73 74 72 75 63 74 |sh_arg_i|n_struct|
|00003050| 0d 20 20 20 69 66 20 69 | 74 20 6e 6f 74 69 63 65 |. if i|t notice|
|00003060| 73 20 61 20 72 65 66 65 | 72 65 6e 63 65 20 74 6f |s a refe|rence to|
|00003070| 20 6d 65 6d 6f 72 79 20 | 74 68 61 74 27 73 20 70 | memory |that's p|
|00003080| 61 72 74 20 6f 66 20 61 | 20 73 74 72 75 63 74 75 |art of a| structu|
|00003090| 72 65 2e 20 20 2a 2f 0d | 0d 73 74 61 74 69 63 20 |re. */.|.static |
|000030a0| 69 6e 74 20 68 61 73 68 | 5f 61 72 67 5f 69 6e 5f |int hash|_arg_in_|
|000030b0| 73 74 72 75 63 74 3b 0d | 0d 2f 2a 20 54 68 65 20 |struct;.|./* The |
|000030c0| 68 61 73 68 20 74 61 62 | 6c 65 20 63 6f 6e 74 61 |hash tab|le conta|
|000030d0| 69 6e 73 20 62 75 63 6b | 65 74 73 20 77 68 69 63 |ins buck|ets whic|
|000030e0| 68 20 61 72 65 20 63 68 | 61 69 6e 73 20 6f 66 20 |h are ch|ains of |
|000030f0| 60 73 74 72 75 63 74 20 | 74 61 62 6c 65 5f 65 6c |`struct |table_el|
|00003100| 74 27 73 2c 0d 20 20 20 | 65 61 63 68 20 72 65 63 |t's,. |each rec|
|00003110| 6f 72 64 69 6e 67 20 6f | 6e 65 20 65 78 70 72 65 |ording o|ne expre|
|00003120| 73 73 69 6f 6e 27 73 20 | 69 6e 66 6f 72 6d 61 74 |ssion's |informat|
|00003130| 69 6f 6e 2e 0d 20 20 20 | 54 68 61 74 20 65 78 70 |ion.. |That exp|
|00003140| 72 65 73 73 69 6f 6e 20 | 69 73 20 69 6e 20 74 68 |ression |is in th|
|00003150| 65 20 60 65 78 70 27 20 | 66 69 65 6c 64 2e 0d 0d |e `exp' |field...|
|00003160| 20 20 20 54 68 6f 73 65 | 20 65 6c 65 6d 65 6e 74 | Those| element|
|00003170| 73 20 77 69 74 68 20 74 | 68 65 20 73 61 6d 65 20 |s with t|he same |
|00003180| 68 61 73 68 20 63 6f 64 | 65 20 61 72 65 20 63 68 |hash cod|e are ch|
|00003190| 61 69 6e 65 64 20 69 6e | 20 62 6f 74 68 20 64 69 |ained in| both di|
|000031a0| 72 65 63 74 69 6f 6e 73 | 0d 20 20 20 74 68 72 6f |rections|. thro|
|000031b0| 75 67 68 20 74 68 65 20 | 60 6e 65 78 74 5f 73 61 |ugh the |`next_sa|
|000031c0| 6d 65 5f 68 61 73 68 27 | 20 61 6e 64 20 60 70 72 |me_hash'| and `pr|
|000031d0| 65 76 5f 73 61 6d 65 5f | 68 61 73 68 27 20 66 69 |ev_same_|hash' fi|
|000031e0| 65 6c 64 73 2e 0d 0d 20 | 20 20 45 61 63 68 20 73 |elds... | Each s|
|000031f0| 65 74 20 6f 66 20 65 78 | 70 72 65 73 73 69 6f 6e |et of ex|pression|
|00003200| 73 20 77 69 74 68 20 65 | 71 75 69 76 61 6c 65 6e |s with e|quivalen|
|00003210| 74 20 76 61 6c 75 65 73 | 0d 20 20 20 61 72 65 20 |t values|. are |
|00003220| 6f 6e 20 61 20 74 77 6f | 2d 77 61 79 20 63 68 61 |on a two|-way cha|
|00003230| 69 6e 20 74 68 72 6f 75 | 67 68 20 74 68 65 20 60 |in throu|gh the `|
|00003240| 6e 65 78 74 5f 73 61 6d | 65 5f 76 61 6c 75 65 27 |next_sam|e_value'|
|00003250| 0d 20 20 20 61 6e 64 20 | 60 70 72 65 76 5f 73 61 |. and |`prev_sa|
|00003260| 6d 65 5f 76 61 6c 75 65 | 27 20 66 69 65 6c 64 73 |me_value|' fields|
|00003270| 2c 20 61 6e 64 20 61 6c | 6c 20 70 6f 69 6e 74 20 |, and al|l point |
|00003280| 77 69 74 68 0d 20 20 20 | 74 68 65 20 60 66 69 72 |with. |the `fir|
|00003290| 73 74 5f 73 61 6d 65 5f | 76 61 6c 75 65 27 20 66 |st_same_|value' f|
|000032a0| 69 65 6c 64 20 61 74 20 | 74 68 65 20 66 69 72 73 |ield at |the firs|
|000032b0| 74 20 65 6c 65 6d 65 6e | 74 20 69 6e 0d 20 20 20 |t elemen|t in. |
|000032c0| 74 68 61 74 20 63 68 61 | 69 6e 2e 20 20 54 68 65 |that cha|in. The|
|000032d0| 20 63 68 61 69 6e 20 69 | 73 20 69 6e 20 6f 72 64 | chain i|s in ord|
|000032e0| 65 72 20 6f 66 20 69 6e | 63 72 65 61 73 69 6e 67 |er of in|creasing|
|000032f0| 20 63 6f 73 74 2e 0d 20 | 20 20 45 61 63 68 20 65 | cost.. | Each e|
|00003300| 6c 65 6d 65 6e 74 27 73 | 20 63 6f 73 74 20 76 61 |lement's| cost va|
|00003310| 6c 75 65 20 69 73 20 69 | 6e 20 69 74 73 20 60 63 |lue is i|n its `c|
|00003320| 6f 73 74 27 20 66 69 65 | 6c 64 2e 0d 0d 20 20 20 |ost' fie|ld... |
|00003330| 54 68 65 20 60 69 6e 5f | 6d 65 6d 6f 72 79 27 20 |The `in_|memory' |
|00003340| 66 69 65 6c 64 20 69 73 | 20 6e 6f 6e 7a 65 72 6f |field is| nonzero|
|00003350| 20 66 6f 72 20 65 6c 65 | 6d 65 6e 74 73 20 74 68 | for ele|ments th|
|00003360| 61 74 0d 20 20 20 69 6e | 76 6f 6c 76 65 20 61 6e |at. in|volve an|
|00003370| 79 20 72 65 66 65 72 65 | 6e 63 65 20 74 6f 20 6d |y refere|nce to m|
|00003380| 65 6d 6f 72 79 2e 20 20 | 54 68 65 73 65 20 65 6c |emory. |These el|
|00003390| 65 6d 65 6e 74 73 20 61 | 72 65 20 72 65 6d 6f 76 |ements a|re remov|
|000033a0| 65 64 0d 20 20 20 77 68 | 65 6e 65 76 65 72 20 61 |ed. wh|enever a|
|000033b0| 20 77 72 69 74 65 20 69 | 73 20 64 6f 6e 65 20 74 | write i|s done t|
|000033c0| 6f 20 61 6e 20 75 6e 69 | 64 65 6e 74 69 66 69 65 |o an uni|dentifie|
|000033d0| 64 20 6c 6f 63 61 74 69 | 6f 6e 20 69 6e 20 6d 65 |d locati|on in me|
|000033e0| 6d 6f 72 79 2e 0d 20 20 | 20 54 6f 20 62 65 20 73 |mory.. | To be s|
|000033f0| 61 66 65 2c 20 77 65 20 | 61 73 73 75 6d 65 20 74 |afe, we |assume t|
|00003400| 68 61 74 20 61 20 6d 65 | 6d 6f 72 79 20 61 64 64 |hat a me|mory add|
|00003410| 72 65 73 73 20 69 73 20 | 75 6e 69 64 65 6e 74 69 |ress is |unidenti|
|00003420| 66 69 65 64 20 75 6e 6c | 65 73 73 0d 20 20 20 74 |fied unl|ess. t|
|00003430| 68 65 20 61 64 64 72 65 | 73 73 20 69 73 20 65 69 |he addre|ss is ei|
|00003440| 74 68 65 72 20 61 20 73 | 79 6d 62 6f 6c 20 63 6f |ther a s|ymbol co|
|00003450| 6e 73 74 61 6e 74 20 6f | 72 20 61 20 63 6f 6e 73 |nstant o|r a cons|
|00003460| 74 61 6e 74 20 70 6c 75 | 73 0d 20 20 20 74 68 65 |tant plu|s. the|
|00003470| 20 66 72 61 6d 65 20 70 | 6f 69 6e 74 65 72 20 6f | frame p|ointer o|
|00003480| 72 20 61 72 67 75 6d 65 | 6e 74 20 70 6f 69 6e 74 |r argume|nt point|
|00003490| 65 72 2e 0d 0d 20 20 20 | 54 68 65 20 60 69 6e 5f |er... |The `in_|
|000034a0| 73 74 72 75 63 74 27 20 | 66 69 65 6c 64 20 69 73 |struct' |field is|
|000034b0| 20 6e 6f 6e 7a 65 72 6f | 20 66 6f 72 20 65 6c 65 | nonzero| for ele|
|000034c0| 6d 65 6e 74 73 20 74 68 | 61 74 0d 20 20 20 69 6e |ments th|at. in|
|000034d0| 76 6f 6c 76 65 20 61 6e | 79 20 72 65 66 65 72 65 |volve an|y refere|
|000034e0| 6e 63 65 20 74 6f 20 6d | 65 6d 6f 72 79 20 69 6e |nce to m|emory in|
|000034f0| 73 69 64 65 20 61 20 73 | 74 72 75 63 74 75 72 65 |side a s|tructure|
|00003500| 20 6f 72 20 61 72 72 61 | 79 2e 0d 0d 20 20 20 54 | or arra|y... T|
|00003510| 68 65 20 60 65 71 75 69 | 76 61 6c 65 6e 63 65 5f |he `equi|valence_|
|00003520| 6f 6e 6c 79 27 20 66 69 | 65 6c 64 20 6d 65 61 6e |only' fi|eld mean|
|00003530| 73 20 74 68 61 74 20 74 | 68 69 73 20 65 78 70 72 |s that t|his expr|
|00003540| 65 73 73 69 6f 6e 20 63 | 61 6d 65 20 66 72 6f 6d |ession c|ame from|
|00003550| 20 61 0d 20 20 20 52 45 | 47 5f 45 51 55 49 56 20 | a. RE|G_EQUIV |
|00003560| 6f 72 20 52 45 47 5f 45 | 51 55 41 4c 20 6e 6f 74 |or REG_E|QUAL not|
|00003570| 65 3b 20 69 74 20 69 73 | 20 6e 6f 74 20 76 61 6c |e; it is| not val|
|00003580| 69 64 20 66 6f 72 20 73 | 75 62 73 74 69 74 75 74 |id for s|ubstitut|
|00003590| 69 6f 6e 20 69 6e 74 6f | 20 61 6e 20 69 6e 73 6e |ion into| an insn|
|000035a0| 2e 0d 0d 20 20 20 54 68 | 65 20 60 72 65 6c 61 74 |... Th|e `relat|
|000035b0| 65 64 5f 76 61 6c 75 65 | 27 20 66 69 65 6c 64 20 |ed_value|' field |
|000035c0| 69 73 20 75 73 65 64 20 | 74 6f 20 63 6f 6e 6e 65 |is used |to conne|
|000035d0| 63 74 20 72 65 6c 61 74 | 65 64 20 65 78 70 72 65 |ct relat|ed expre|
|000035e0| 73 73 69 6f 6e 73 0d 20 | 20 20 28 74 68 61 74 20 |ssions. | (that |
|000035f0| 64 69 66 66 65 72 20 62 | 79 20 61 64 64 69 6e 67 |differ b|y adding|
|00003600| 20 61 6e 20 69 6e 74 65 | 67 65 72 29 2e 0d 20 20 | an inte|ger).. |
|00003610| 20 54 68 65 20 72 65 6c | 61 74 65 64 20 65 78 70 | The rel|ated exp|
|00003620| 72 65 73 73 69 6f 6e 73 | 20 61 72 65 20 63 68 61 |ressions| are cha|
|00003630| 69 6e 65 64 20 69 6e 20 | 61 20 63 69 72 63 75 6c |ined in |a circul|
|00003640| 61 72 20 66 61 73 68 69 | 6f 6e 2e 0d 20 20 20 60 |ar fashi|on.. `|
|00003650| 72 65 6c 61 74 65 64 5f | 76 61 6c 75 65 27 20 69 |related_|value' i|
|00003660| 73 20 7a 65 72 6f 20 66 | 6f 72 20 65 78 70 72 65 |s zero f|or expre|
|00003670| 73 73 69 6f 6e 73 20 66 | 6f 72 20 77 68 69 63 68 |ssions f|or which|
|00003680| 20 74 68 69 73 0d 20 20 | 20 63 68 61 69 6e 20 69 | this. | chain i|
|00003690| 73 20 6e 6f 74 20 75 73 | 65 66 75 6c 2e 0d 0d 20 |s not us|eful... |
|000036a0| 20 20 54 68 65 20 60 6d | 6f 64 65 27 20 66 69 65 | The `m|ode' fie|
|000036b0| 6c 64 20 69 73 20 75 73 | 75 61 6c 6c 79 20 74 68 |ld is us|ually th|
|000036c0| 65 20 73 61 6d 65 20 61 | 73 20 47 45 54 5f 4d 4f |e same a|s GET_MO|
|000036d0| 44 45 20 28 60 65 78 70 | 27 29 2c 20 62 75 74 0d |DE (`exp|'), but.|
|000036e0| 20 20 20 69 66 20 60 65 | 78 70 27 20 69 73 20 61 | if `e|xp' is a|
|000036f0| 20 43 4f 4e 53 54 5f 49 | 4e 54 20 61 6e 64 20 68 | CONST_I|NT and h|
|00003700| 61 73 20 6e 6f 20 6d 61 | 63 68 69 6e 65 20 6d 6f |as no ma|chine mo|
|00003710| 64 65 20 74 68 65 6e 20 | 74 68 65 20 60 6d 6f 64 |de then |the `mod|
|00003720| 65 27 0d 20 20 20 66 69 | 65 6c 64 20 69 73 20 74 |e'. fi|eld is t|
|00003730| 68 65 20 6d 6f 64 65 20 | 69 74 20 77 61 73 20 62 |he mode |it was b|
|00003740| 65 69 6e 67 20 75 73 65 | 64 20 61 73 2e 20 20 45 |eing use|d as. E|
|00003750| 61 63 68 20 63 6f 6e 73 | 74 61 6e 74 20 69 73 0d |ach cons|tant is.|
|00003760| 20 20 20 72 65 63 6f 72 | 64 65 64 20 73 65 70 61 | recor|ded sepa|
|00003770| 72 61 74 65 6c 79 20 66 | 6f 72 20 65 61 63 68 20 |rately f|or each |
|00003780| 6d 6f 64 65 20 69 74 20 | 69 73 20 75 73 65 64 20 |mode it |is used |
|00003790| 77 69 74 68 2e 20 20 2a | 2f 0d 0d 0d 73 74 72 75 |with. *|/...stru|
|000037a0| 63 74 20 74 61 62 6c 65 | 5f 65 6c 74 0d 7b 0d 20 |ct table|_elt.{. |
|000037b0| 20 72 74 78 20 65 78 70 | 3b 0d 20 20 73 74 72 75 | rtx exp|;. stru|
|000037c0| 63 74 20 74 61 62 6c 65 | 5f 65 6c 74 20 2a 6e 65 |ct table|_elt *ne|
|000037d0| 78 74 5f 73 61 6d 65 5f | 68 61 73 68 3b 0d 20 20 |xt_same_|hash;. |
|000037e0| 73 74 72 75 63 74 20 74 | 61 62 6c 65 5f 65 6c 74 |struct t|able_elt|
|000037f0| 20 2a 70 72 65 76 5f 73 | 61 6d 65 5f 68 61 73 68 | *prev_s|ame_hash|
|00003800| 3b 0d 20 20 73 74 72 75 | 63 74 20 74 61 62 6c 65 |;. stru|ct table|
|00003810| 5f 65 6c 74 20 2a 6e 65 | 78 74 5f 73 61 6d 65 5f |_elt *ne|xt_same_|
|00003820| 76 61 6c 75 65 3b 0d 20 | 20 73 74 72 75 63 74 20 |value;. | struct |
|00003830| 74 61 62 6c 65 5f 65 6c | 74 20 2a 70 72 65 76 5f |table_el|t *prev_|
|00003840| 73 61 6d 65 5f 76 61 6c | 75 65 3b 0d 20 20 73 74 |same_val|ue;. st|
|00003850| 72 75 63 74 20 74 61 62 | 6c 65 5f 65 6c 74 20 2a |ruct tab|le_elt *|
|00003860| 66 69 72 73 74 5f 73 61 | 6d 65 5f 76 61 6c 75 65 |first_sa|me_value|
|00003870| 3b 0d 20 20 73 74 72 75 | 63 74 20 74 61 62 6c 65 |;. stru|ct table|
|00003880| 5f 65 6c 74 20 2a 72 65 | 6c 61 74 65 64 5f 76 61 |_elt *re|lated_va|
|00003890| 6c 75 65 3b 0d 20 20 69 | 6e 74 20 63 6f 73 74 3b |lue;. i|nt cost;|
|000038a0| 0d 20 20 65 6e 75 6d 20 | 6d 61 63 68 69 6e 65 5f |. enum |machine_|
|000038b0| 6d 6f 64 65 20 6d 6f 64 | 65 3b 0d 20 20 63 68 61 |mode mod|e;. cha|
|000038c0| 72 20 69 6e 5f 6d 65 6d | 6f 72 79 3b 0d 20 20 63 |r in_mem|ory;. c|
|000038d0| 68 61 72 20 69 6e 5f 73 | 74 72 75 63 74 3b 0d 20 |har in_s|truct;. |
|000038e0| 20 63 68 61 72 20 65 71 | 75 69 76 61 6c 65 6e 63 | char eq|uivalenc|
|000038f0| 65 5f 6f 6e 6c 79 3b 0d | 7d 3b 0d 0d 23 64 65 66 |e_only;.|};..#def|
|00003900| 69 6e 65 20 48 41 53 48 | 28 78 2c 20 6d 29 20 28 |ine HASH|(x, m) (|
|00003910| 63 61 6e 6f 6e 5f 68 61 | 73 68 20 28 78 2c 20 6d |canon_ha|sh (x, m|
|00003920| 29 20 25 20 4e 42 55 43 | 4b 45 54 53 29 0d 2f 2a |) % NBUC|KETS)./*|
|00003930| 20 57 65 20 64 6f 6e 27 | 74 20 77 61 6e 74 20 61 | We don'|t want a|
|00003940| 20 6c 6f 74 20 6f 66 20 | 62 75 63 6b 65 74 73 2c | lot of |buckets,|
|00003950| 20 62 65 63 61 75 73 65 | 20 77 65 20 72 61 72 65 | because| we rare|
|00003960| 6c 79 20 68 61 76 65 20 | 76 65 72 79 20 6d 61 6e |ly have |very man|
|00003970| 79 0d 20 20 20 74 68 69 | 6e 67 73 20 73 74 6f 72 |y. thi|ngs stor|
|00003980| 65 64 20 69 6e 20 74 68 | 65 20 68 61 73 68 20 74 |ed in th|e hash t|
|00003990| 61 62 6c 65 2c 20 61 6e | 64 20 61 20 6c 6f 74 20 |able, an|d a lot |
|000039a0| 6f 66 20 62 75 63 6b 65 | 74 73 20 73 6c 6f 77 73 |of bucke|ts slows|
|000039b0| 0d 20 20 20 64 6f 77 6e | 20 61 20 6c 6f 74 20 6f |. down| a lot o|
|000039c0| 66 20 6c 6f 6f 70 73 20 | 74 68 61 74 20 68 61 70 |f loops |that hap|
|000039d0| 70 65 6e 20 66 72 65 71 | 75 65 6e 74 6c 79 2e 20 |pen freq|uently. |
|000039e0| 20 2a 2f 0d 23 64 65 66 | 69 6e 65 20 4e 42 55 43 | */.#def|ine NBUC|
|000039f0| 4b 45 54 53 20 33 31 0d | 0d 73 74 61 74 69 63 20 |KETS 31.|.static |
|00003a00| 73 74 72 75 63 74 20 74 | 61 62 6c 65 5f 65 6c 74 |struct t|able_elt|
|00003a10| 20 2a 74 61 62 6c 65 5b | 4e 42 55 43 4b 45 54 53 | *table[|NBUCKETS|
|00003a20| 5d 3b 0d 0d 2f 2a 20 43 | 68 61 69 6e 20 6f 66 20 |];../* C|hain of |
|00003a30| 60 73 74 72 75 63 74 20 | 74 61 62 6c 65 5f 65 6c |`struct |table_el|
|00003a40| 74 27 73 20 6d 61 64 65 | 20 73 6f 20 66 61 72 20 |t's made| so far |
|00003a50| 66 6f 72 20 74 68 69 73 | 20 66 75 6e 63 74 69 6f |for this| functio|
|00003a60| 6e 0d 20 20 20 62 75 74 | 20 63 75 72 72 65 6e 74 |n. but| current|
|00003a70| 6c 79 20 72 65 6d 6f 76 | 65 64 20 66 72 6f 6d 20 |ly remov|ed from |
|00003a80| 74 68 65 20 74 61 62 6c | 65 2e 20 20 2a 2f 0d 0d |the tabl|e. */..|
|00003a90| 73 74 61 74 69 63 20 73 | 74 72 75 63 74 20 74 61 |static s|truct ta|
|00003aa0| 62 6c 65 5f 65 6c 74 20 | 2a 66 72 65 65 5f 65 6c |ble_elt |*free_el|
|00003ab0| 65 6d 65 6e 74 5f 63 68 | 61 69 6e 3b 0d 0d 2f 2a |ement_ch|ain;../*|
|00003ac0| 20 4e 75 6d 62 65 72 20 | 6f 66 20 60 73 74 72 75 | Number |of `stru|
|00003ad0| 63 74 20 74 61 62 6c 65 | 5f 65 6c 74 27 20 73 74 |ct table|_elt' st|
|00003ae0| 72 75 63 74 75 72 65 73 | 20 6d 61 64 65 20 73 6f |ructures| made so|
|00003af0| 20 66 61 72 20 66 6f 72 | 20 74 68 69 73 20 66 75 | far for| this fu|
|00003b00| 6e 63 74 69 6f 6e 2e 20 | 20 2a 2f 0d 0d 73 74 61 |nction. | */..sta|
|00003b10| 74 69 63 20 69 6e 74 20 | 6e 5f 65 6c 65 6d 65 6e |tic int |n_elemen|
|00003b20| 74 73 5f 6d 61 64 65 3b | 0d 0d 2f 2a 20 4d 61 78 |ts_made;|../* Max|
|00003b30| 69 6d 75 6d 20 76 61 6c | 75 65 20 60 6e 5f 65 6c |imum val|ue `n_el|
|00003b40| 65 6d 65 6e 74 73 5f 6d | 61 64 65 27 20 68 61 73 |ements_m|ade' has|
|00003b50| 20 68 61 64 20 73 6f 20 | 66 61 72 20 69 6e 20 74 | had so |far in t|
|00003b60| 68 69 73 20 63 6f 6d 70 | 69 6c 61 74 69 6f 6e 0d |his comp|ilation.|
|00003b70| 20 20 20 66 6f 72 20 66 | 75 6e 63 74 69 6f 6e 73 | for f|unctions|
|00003b80| 20 70 72 65 76 69 6f 75 | 73 6c 79 20 70 72 6f 63 | previou|sly proc|
|00003b90| 65 73 73 65 64 2e 20 20 | 2a 2f 0d 0d 73 74 61 74 |essed. |*/..stat|
|00003ba0| 69 63 20 69 6e 74 20 6d | 61 78 5f 65 6c 65 6d 65 |ic int m|ax_eleme|
|00003bb0| 6e 74 73 5f 6d 61 64 65 | 3b 0d 0d 2f 2a 20 42 69 |nts_made|;../* Bi|
|00003bc0| 74 73 20 64 65 73 63 72 | 69 62 69 6e 67 20 77 68 |ts descr|ibing wh|
|00003bd0| 61 74 20 6b 69 6e 64 20 | 6f 66 20 76 61 6c 75 65 |at kind |of value|
|00003be0| 73 20 69 6e 20 6d 65 6d | 6f 72 79 20 6d 75 73 74 |s in mem|ory must|
|00003bf0| 20 62 65 20 69 6e 76 61 | 6c 69 64 61 74 65 64 0d | be inva|lidated.|
|00003c00| 20 20 20 66 6f 72 20 61 | 20 70 61 72 74 69 63 75 | for a| particu|
|00003c10| 6c 61 72 20 69 6e 73 74 | 72 75 63 74 69 6f 6e 2e |lar inst|ruction.|
|00003c20| 20 20 49 66 20 61 6c 6c | 20 74 68 72 65 65 20 62 | If all| three b|
|00003c30| 69 74 73 20 61 72 65 20 | 7a 65 72 6f 2c 0d 20 20 |its are |zero,. |
|00003c40| 20 6e 6f 20 6d 65 6d 6f | 72 79 20 72 65 66 73 20 | no memo|ry refs |
|00003c50| 6e 65 65 64 20 74 6f 20 | 62 65 20 69 6e 76 61 6c |need to |be inval|
|00003c60| 69 64 61 74 65 64 2e 20 | 20 45 61 63 68 20 62 69 |idated. | Each bi|
|00003c70| 74 20 69 73 20 6d 6f 72 | 65 20 70 6f 77 65 72 66 |t is mor|e powerf|
|00003c80| 75 6c 0d 20 20 20 74 68 | 61 6e 20 74 68 65 20 70 |ul. th|an the p|
|00003c90| 72 65 63 65 64 69 6e 67 | 20 6f 6e 65 73 2c 20 61 |receding| ones, a|
|00003ca0| 6e 64 20 69 66 20 61 20 | 62 69 74 20 69 73 20 73 |nd if a |bit is s|
|00003cb0| 65 74 20 74 68 65 6e 20 | 74 68 65 20 70 72 65 63 |et then |the prec|
|00003cc0| 65 64 69 6e 67 0d 20 20 | 20 62 69 74 73 20 61 72 |eding. | bits ar|
|00003cd0| 65 20 61 6c 73 6f 20 73 | 65 74 2e 0d 0d 20 20 20 |e also s|et... |
|00003ce0| 48 65 72 65 20 69 73 20 | 68 6f 77 20 74 68 65 20 |Here is |how the |
|00003cf0| 62 69 74 73 20 61 72 65 | 20 73 65 74 2e 0d 20 20 |bits are| set.. |
|00003d00| 20 57 72 69 74 69 6e 67 | 20 61 74 20 61 20 66 69 | Writing| at a fi|
|00003d10| 78 65 64 20 61 64 64 72 | 65 73 73 20 69 6e 76 61 |xed addr|ess inva|
|00003d20| 6c 69 64 61 74 65 73 20 | 6f 6e 6c 79 20 76 61 72 |lidates |only var|
|00003d30| 69 61 62 6c 65 20 61 64 | 64 72 65 73 73 65 73 2c |iable ad|dresses,|
|00003d40| 0d 20 20 20 77 72 69 74 | 69 6e 67 20 69 6e 20 61 |. writ|ing in a|
|00003d50| 20 73 74 72 75 63 74 75 | 72 65 20 65 6c 65 6d 65 | structu|re eleme|
|00003d60| 6e 74 20 61 74 20 76 61 | 72 69 61 62 6c 65 20 61 |nt at va|riable a|
|00003d70| 64 64 72 65 73 73 0d 20 | 20 20 20 20 69 6e 76 61 |ddress. | inva|
|00003d80| 6c 69 64 61 74 65 73 20 | 61 6c 6c 20 62 75 74 20 |lidates |all but |
|00003d90| 73 63 61 6c 61 72 20 76 | 61 72 69 61 62 6c 65 73 |scalar v|ariables|
|00003da0| 2c 0d 20 20 20 61 6e 64 | 20 77 72 69 74 69 6e 67 |,. and| writing|
|00003db0| 20 69 6e 20 61 6e 79 74 | 68 69 6e 67 20 65 6c 73 | in anyt|hing els|
|00003dc0| 65 20 61 74 20 76 61 72 | 69 61 62 6c 65 20 61 64 |e at var|iable ad|
|00003dd0| 64 72 65 73 73 20 69 6e | 76 61 6c 69 64 61 74 65 |dress in|validate|
|00003de0| 73 20 65 76 65 72 79 74 | 68 69 6e 67 2e 20 20 2a |s everyt|hing. *|
|00003df0| 2f 0d 0d 73 74 72 75 63 | 74 20 77 72 69 74 65 5f |/..struc|t write_|
|00003e00| 64 61 74 61 0d 7b 0d 20 | 20 69 6e 74 20 76 61 72 |data.{. | int var|
|00003e10| 20 3a 20 31 3b 09 09 09 | 2f 2a 20 49 6e 76 61 6c | : 1;...|/* Inval|
|00003e20| 69 64 61 74 65 20 76 61 | 72 69 61 62 6c 65 20 61 |idate va|riable a|
|00003e30| 64 64 72 65 73 73 65 73 | 2e 20 20 2a 2f 0d 20 20 |ddresses|. */. |
|00003e40| 69 6e 74 20 6e 6f 6e 73 | 63 61 6c 61 72 20 3a 20 |int nons|calar : |
|00003e50| 31 3b 09 09 2f 2a 20 49 | 6e 76 61 6c 69 64 61 74 |1;../* I|nvalidat|
|00003e60| 65 20 61 6c 6c 20 62 75 | 74 20 73 63 61 6c 61 72 |e all bu|t scalar|
|00003e70| 20 76 61 72 69 61 62 6c | 65 73 2e 20 20 2a 2f 0d | variabl|es. */.|
|00003e80| 20 20 69 6e 74 20 61 6c | 6c 20 3a 20 31 3b 09 09 | int al|l : 1;..|
|00003e90| 09 2f 2a 20 49 6e 76 61 | 6c 69 64 61 74 65 20 61 |./* Inva|lidate a|
|00003ea0| 6c 6c 20 6d 65 6d 6f 72 | 79 20 72 65 66 73 2e 20 |ll memor|y refs. |
|00003eb0| 20 2a 2f 0d 7d 3b 0d 0d | 2f 2a 20 4e 6f 6e 7a 65 | */.};..|/* Nonze|
|00003ec0| 72 6f 20 69 66 20 58 20 | 68 61 73 20 74 68 65 20 |ro if X |has the |
|00003ed0| 66 6f 72 6d 20 28 50 4c | 55 53 20 66 72 61 6d 65 |form (PL|US frame|
|00003ee0| 2d 70 6f 69 6e 74 65 72 | 20 69 6e 74 65 67 65 72 |-pointer| integer|
|00003ef0| 29 2e 20 20 2a 2f 0d 0d | 23 64 65 66 69 6e 65 20 |). */..|#define |
|00003f00| 46 49 58 45 44 5f 42 41 | 53 45 5f 50 4c 55 53 5f |FIXED_BA|SE_PLUS_|
|00003f10| 50 28 58 29 09 09 09 09 | 09 5c 0d 20 20 28 47 45 |P(X)....|.\. (GE|
|00003f20| 54 5f 43 4f 44 45 20 28 | 58 29 20 3d 3d 20 50 4c |T_CODE (|X) == PL|
|00003f30| 55 53 20 26 26 20 47 45 | 54 5f 43 4f 44 45 20 28 |US && GE|T_CODE (|
|00003f40| 58 45 58 50 20 28 58 2c | 20 31 29 29 20 3d 3d 20 |XEXP (X,| 1)) == |
|00003f50| 43 4f 4e 53 54 5f 49 4e | 54 09 5c 0d 20 20 20 26 |CONST_IN|T.\. &|
|00003f60| 26 20 28 58 45 58 50 20 | 28 58 2c 20 30 29 20 3d |& (XEXP |(X, 0) =|
|00003f70| 3d 20 66 72 61 6d 65 5f | 70 6f 69 6e 74 65 72 5f |= frame_|pointer_|
|00003f80| 72 74 78 20 7c 7c 20 58 | 45 58 50 20 28 58 2c 20 |rtx || X|EXP (X, |
|00003f90| 30 29 20 3d 3d 20 61 72 | 67 5f 70 6f 69 6e 74 65 |0) == ar|g_pointe|
|00003fa0| 72 5f 72 74 78 29 29 0d | 0d 73 74 61 74 69 63 20 |r_rtx)).|.static |
|00003fb0| 73 74 72 75 63 74 20 74 | 61 62 6c 65 5f 65 6c 74 |struct t|able_elt|
|00003fc0| 20 2a 6c 6f 6f 6b 75 70 | 20 28 29 3b 0d 73 74 61 | *lookup| ();.sta|
|00003fd0| 74 69 63 20 76 6f 69 64 | 20 66 72 65 65 5f 65 6c |tic void| free_el|
|00003fe0| 65 6d 65 6e 74 20 28 29 | 3b 0d 0d 73 74 61 74 69 |ement ()|;..stati|
|00003ff0| 63 20 76 6f 69 64 20 72 | 65 6d 6f 76 65 5f 69 6e |c void r|emove_in|
|00004000| 76 61 6c 69 64 5f 72 65 | 66 73 20 28 29 3b 0d 73 |valid_re|fs ();.s|
|00004010| 74 61 74 69 63 20 69 6e | 74 20 65 78 70 5f 65 71 |tatic in|t exp_eq|
|00004020| 75 69 76 5f 70 20 28 29 | 3b 0d 69 6e 74 20 72 65 |uiv_p ()|;.int re|
|00004030| 66 65 72 73 5f 74 6f 5f | 70 20 28 29 3b 0d 69 6e |fers_to_|p ();.in|
|00004040| 74 20 72 65 66 65 72 73 | 5f 74 6f 5f 6d 65 6d 5f |t refers|_to_mem_|
|00004050| 70 20 28 29 3b 0d 73 74 | 61 74 69 63 20 76 6f 69 |p ();.st|atic voi|
|00004060| 64 20 69 6e 76 61 6c 69 | 64 61 74 65 5f 66 72 6f |d invali|date_fro|
|00004070| 6d 5f 63 6c 6f 62 62 65 | 72 73 20 28 29 3b 0d 73 |m_clobbe|rs ();.s|
|00004080| 74 61 74 69 63 20 69 6e | 74 20 73 61 66 65 5f 68 |tatic in|t safe_h|
|00004090| 61 73 68 20 28 29 3b 0d | 73 74 61 74 69 63 20 69 |ash ();.|static i|
|000040a0| 6e 74 20 63 61 6e 6f 6e | 5f 68 61 73 68 20 28 29 |nt canon|_hash ()|
|000040b0| 3b 0d 73 74 61 74 69 63 | 20 72 74 78 20 65 71 75 |;.static| rtx equ|
|000040c0| 69 76 5f 63 6f 6e 73 74 | 61 6e 74 20 28 29 3b 0d |iv_const|ant ();.|
|000040d0| 73 74 61 74 69 63 20 69 | 6e 74 20 67 65 74 5f 69 |static i|nt get_i|
|000040e0| 6e 74 65 67 65 72 5f 74 | 65 72 6d 20 28 29 3b 0d |nteger_t|erm ();.|
|000040f0| 73 74 61 74 69 63 20 72 | 74 78 20 67 65 74 5f 72 |static r|tx get_r|
|00004100| 65 6c 61 74 65 64 5f 76 | 61 6c 75 65 20 28 29 3b |elated_v|alue ();|
|00004110| 0d 73 74 61 74 69 63 20 | 76 6f 69 64 20 6e 6f 74 |.static |void not|
|00004120| 65 5f 6d 65 6d 5f 77 72 | 69 74 74 65 6e 20 28 29 |e_mem_wr|itten ()|
|00004130| 3b 0d 73 74 61 74 69 63 | 20 69 6e 74 20 63 73 65 |;.static| int cse|
|00004140| 5f 72 74 78 5f 61 64 64 | 72 5f 76 61 72 69 65 73 |_rtx_add|r_varies|
|00004150| 5f 70 20 28 29 3b 0d 73 | 74 61 74 69 63 20 69 6e |_p ();.s|tatic in|
|00004160| 74 20 66 6f 6c 64 5f 63 | 63 30 20 28 29 3b 0d 0c |t fold_c|c0 ();..|
|00004170| 0d 2f 2a 20 52 65 74 75 | 72 6e 20 61 6e 20 65 73 |./* Retu|rn an es|
|00004180| 74 69 6d 61 74 65 20 6f | 66 20 74 68 65 20 63 6f |timate o|f the co|
|00004190| 73 74 20 6f 66 20 63 6f | 6d 70 75 74 69 6e 67 20 |st of co|mputing |
|000041a0| 72 74 78 20 58 2e 0d 20 | 20 20 54 68 65 20 6f 6e |rtx X.. | The on|
|000041b0| 6c 79 20 75 73 65 20 6f | 66 20 74 68 69 73 20 69 |ly use o|f this i|
|000041c0| 73 20 74 6f 20 63 6f 6d | 70 61 72 65 20 74 68 65 |s to com|pare the|
|000041d0| 20 63 6f 73 74 73 20 6f | 66 20 74 77 6f 20 65 78 | costs o|f two ex|
|000041e0| 70 72 65 73 73 69 6f 6e | 73 0d 20 20 20 74 6f 20 |pression|s. to |
|000041f0| 64 65 63 69 64 65 20 77 | 68 65 74 68 65 72 20 74 |decide w|hether t|
|00004200| 6f 20 72 65 70 6c 61 63 | 65 20 6f 6e 65 20 77 69 |o replac|e one wi|
|00004210| 74 68 20 74 68 65 20 6f | 74 68 65 72 2e 20 20 2a |th the o|ther. *|
|00004220| 2f 0d 0d 73 74 61 74 69 | 63 20 69 6e 74 0d 72 74 |/..stati|c int.rt|
|00004230| 78 5f 63 6f 73 74 20 28 | 78 29 0d 20 20 20 20 20 |x_cost (|x). |
|00004240| 72 74 78 20 78 3b 0d 7b | 0d 20 20 72 65 67 69 73 |rtx x;.{|. regis|
|00004250| 74 65 72 20 69 6e 74 20 | 69 2c 20 6a 3b 0d 20 20 |ter int |i, j;. |
|00004260| 72 65 67 69 73 74 65 72 | 20 65 6e 75 6d 20 72 74 |register| enum rt|
|00004270| 78 5f 63 6f 64 65 20 63 | 6f 64 65 3b 0d 20 20 72 |x_code c|ode;. r|
|00004280| 65 67 69 73 74 65 72 20 | 63 68 61 72 20 2a 66 6d |egister |char *fm|
|00004290| 74 3b 0d 20 20 72 65 67 | 69 73 74 65 72 20 69 6e |t;. reg|ister in|
|000042a0| 74 20 74 6f 74 61 6c 3b | 0d 0d 20 20 69 66 20 28 |t total;|.. if (|
|000042b0| 78 20 3d 3d 20 30 29 0d | 20 20 20 20 72 65 74 75 |x == 0).| retu|
|000042c0| 72 6e 20 30 3b 0d 0d 20 | 20 63 6f 64 65 20 3d 20 |rn 0;.. | code = |
|000042d0| 47 45 54 5f 43 4f 44 45 | 20 28 78 29 3b 0d 20 20 |GET_CODE| (x);. |
|000042e0| 73 77 69 74 63 68 20 28 | 63 6f 64 65 29 0d 20 20 |switch (|code). |
|000042f0| 20 20 7b 0d 20 20 20 20 | 63 61 73 65 20 52 45 47 | {. |case REG|
|00004300| 3a 0d 20 20 20 20 20 20 | 72 65 74 75 72 6e 20 31 |:. |return 1|
|00004310| 3b 0d 20 20 20 20 63 61 | 73 65 20 53 55 42 52 45 |;. ca|se SUBRE|
|00004320| 47 3a 0d 20 20 20 20 20 | 20 72 65 74 75 72 6e 20 |G:. | return |
|00004330| 32 3b 0d 20 20 20 20 43 | 4f 4e 53 54 5f 43 4f 53 |2;. C|ONST_COS|
|00004340| 54 53 20 28 78 2c 20 63 | 6f 64 65 29 3b 0d 20 20 |TS (x, c|ode);. |
|00004350| 20 20 7d 0d 0d 20 20 74 | 6f 74 61 6c 20 3d 20 32 | }.. t|otal = 2|
|00004360| 3b 0d 0d 20 20 2f 2a 20 | 53 75 6d 20 74 68 65 20 |;.. /* |Sum the |
|00004370| 63 6f 73 74 73 20 6f 66 | 20 74 68 65 20 73 75 62 |costs of| the sub|
|00004380| 2d 72 74 78 27 73 2c 20 | 70 6c 75 73 20 32 20 6a |-rtx's, |plus 2 j|
|00004390| 75 73 74 20 70 75 74 20 | 69 6e 2e 20 20 2a 2f 0d |ust put |in. */.|
|000043a0| 0d 20 20 66 6d 74 20 3d | 20 47 45 54 5f 52 54 58 |. fmt =| GET_RTX|
|000043b0| 5f 46 4f 52 4d 41 54 20 | 28 63 6f 64 65 29 3b 0d |_FORMAT |(code);.|
|000043c0| 20 20 66 6f 72 20 28 69 | 20 3d 20 47 45 54 5f 52 | for (i| = GET_R|
|000043d0| 54 58 5f 4c 45 4e 47 54 | 48 20 28 63 6f 64 65 29 |TX_LENGT|H (code)|
|000043e0| 20 2d 20 31 3b 20 69 20 | 3e 3d 20 30 3b 20 69 2d | - 1; i |>= 0; i-|
|000043f0| 2d 29 0d 20 20 20 20 69 | 66 20 28 66 6d 74 5b 69 |-). i|f (fmt[i|
|00004400| 5d 20 3d 3d 20 27 65 27 | 29 0d 20 20 20 20 20 20 |] == 'e'|). |
|00004410| 74 6f 74 61 6c 20 2b 3d | 20 72 74 78 5f 63 6f 73 |total +=| rtx_cos|
|00004420| 74 20 28 58 45 58 50 20 | 28 78 2c 20 69 29 29 3b |t (XEXP |(x, i));|
|00004430| 0d 20 20 20 20 65 6c 73 | 65 20 69 66 20 28 66 6d |. els|e if (fm|
|00004440| 74 5b 69 5d 20 3d 3d 20 | 27 45 27 29 0d 20 20 20 |t[i] == |'E'). |
|00004450| 20 20 20 66 6f 72 20 28 | 6a 20 3d 20 30 3b 20 6a | for (|j = 0; j|
|00004460| 20 3c 20 58 56 45 43 4c | 45 4e 20 28 78 2c 20 69 | < XVECL|EN (x, i|
|00004470| 29 3b 20 6a 2b 2b 29 0d | 09 74 6f 74 61 6c 20 2b |); j++).|.total +|
|00004480| 3d 20 72 74 78 5f 63 6f | 73 74 20 28 58 56 45 43 |= rtx_co|st (XVEC|
|00004490| 45 58 50 20 28 78 2c 20 | 69 2c 20 6a 29 29 3b 0d |EXP (x, |i, j));.|
|000044a0| 0d 20 20 72 65 74 75 72 | 6e 20 74 6f 74 61 6c 3b |. retur|n total;|
|000044b0| 0d 7d 0d 0c 0d 2f 2a 20 | 43 6c 65 61 72 20 74 68 |.}.../* |Clear th|
|000044c0| 65 20 68 61 73 68 20 74 | 61 62 6c 65 20 61 6e 64 |e hash t|able and|
|000044d0| 20 69 6e 69 74 69 61 6c | 69 7a 65 20 65 61 63 68 | initial|ize each|
|000044e0| 20 72 65 67 69 73 74 65 | 72 20 77 69 74 68 20 69 | registe|r with i|
|000044f0| 74 73 20 6f 77 6e 20 71 | 75 61 6e 74 69 74 79 2c |ts own q|uantity,|
|00004500| 0d 20 20 20 66 6f 72 20 | 61 20 6e 65 77 20 62 61 |. for |a new ba|
|00004510| 73 69 63 20 62 6c 6f 63 | 6b 2e 20 20 2a 2f 0d 0d |sic bloc|k. */..|
|00004520| 73 74 61 74 69 63 20 76 | 6f 69 64 0d 6e 65 77 5f |static v|oid.new_|
|00004530| 62 61 73 69 63 5f 62 6c | 6f 63 6b 20 28 29 0d 7b |basic_bl|ock ().{|
|00004540| 0d 20 20 72 65 67 69 73 | 74 65 72 20 69 6e 74 20 |. regis|ter int |
|00004550| 69 3b 0d 20 20 72 65 67 | 69 73 74 65 72 20 69 6e |i;. reg|ister in|
|00004560| 74 20 76 65 63 73 69 7a | 65 20 3d 20 6d 61 78 5f |t vecsiz|e = max_|
|00004570| 72 65 67 20 2a 20 73 69 | 7a 65 6f 66 20 28 72 74 |reg * si|zeof (rt|
|00004580| 78 29 3b 0d 20 20 6e 65 | 78 74 5f 71 74 79 20 3d |x);. ne|xt_qty =|
|00004590| 20 6d 61 78 5f 72 65 67 | 3b 0d 0d 20 20 62 7a 65 | max_reg|;.. bze|
|000045a0| 72 6f 20 28 72 65 67 5f | 72 74 78 2c 20 76 65 63 |ro (reg_|rtx, vec|
|000045b0| 73 69 7a 65 29 3b 0d 20 | 20 62 7a 65 72 6f 20 28 |size);. | bzero (|
|000045c0| 72 65 67 5f 74 69 63 6b | 2c 20 76 65 63 73 69 7a |reg_tick|, vecsiz|
|000045d0| 65 29 3b 0d 0d 20 20 62 | 63 6f 70 79 20 28 61 6c |e);.. b|copy (al|
|000045e0| 6c 5f 6d 69 6e 75 73 5f | 6f 6e 65 2c 20 72 65 67 |l_minus_|one, reg|
|000045f0| 5f 69 6e 5f 74 61 62 6c | 65 2c 20 76 65 63 73 69 |_in_tabl|e, vecsi|
|00004600| 7a 65 29 3b 0d 20 20 62 | 63 6f 70 79 20 28 61 6c |ze);. b|copy (al|
|00004610| 6c 5f 6d 69 6e 75 73 5f | 6f 6e 65 2c 20 72 65 67 |l_minus_|one, reg|
|00004620| 5f 6e 65 78 74 5f 65 71 | 76 2c 20 76 65 63 73 69 |_next_eq|v, vecsi|
|00004630| 7a 65 29 3b 0d 20 20 62 | 63 6f 70 79 20 28 61 6c |ze);. b|copy (al|
|00004640| 6c 5f 6d 69 6e 75 73 5f | 6f 6e 65 2c 20 72 65 67 |l_minus_|one, reg|
|00004650| 5f 70 72 65 76 5f 65 71 | 76 2c 20 76 65 63 73 69 |_prev_eq|v, vecsi|
|00004660| 7a 65 29 3b 0d 20 20 62 | 63 6f 70 79 20 28 63 6f |ze);. b|copy (co|
|00004670| 6e 73 65 63 5f 69 6e 74 | 73 2c 20 72 65 67 5f 71 |nsec_int|s, reg_q|
|00004680| 74 79 2c 20 76 65 63 73 | 69 7a 65 29 3b 0d 0d 20 |ty, vecs|ize);.. |
|00004690| 20 66 6f 72 20 28 69 20 | 3d 20 30 3b 20 69 20 3c | for (i |= 0; i <|
|000046a0| 20 6d 61 78 5f 71 74 79 | 3b 20 69 2b 2b 29 0d 20 | max_qty|; i++). |
|000046b0| 20 20 20 7b 0d 20 20 20 | 20 20 20 71 74 79 5f 66 | {. | qty_f|
|000046c0| 69 72 73 74 5f 72 65 67 | 5b 69 5d 20 3d 20 69 3b |irst_reg|[i] = i;|
|000046d0| 0d 20 20 20 20 20 20 71 | 74 79 5f 6c 61 73 74 5f |. q|ty_last_|
|000046e0| 72 65 67 5b 69 5d 20 3d | 20 69 3b 0d 20 20 20 20 |reg[i] =| i;. |
|000046f0| 20 20 71 74 79 5f 63 6f | 6e 73 74 5b 69 5d 20 3d | qty_co|nst[i] =|
|00004700| 20 30 3b 0d 20 20 20 20 | 20 20 71 74 79 5f 63 6f | 0;. | qty_co|
|00004710| 6e 73 74 5f 69 6e 73 6e | 5b 69 5d 20 3d 20 30 3b |nst_insn|[i] = 0;|
|00004720| 0d 20 20 20 20 7d 0d 0d | 20 20 66 6f 72 20 28 69 |. }..| for (i|
|00004730| 20 3d 20 30 3b 20 69 20 | 3c 20 4e 42 55 43 4b 45 | = 0; i |< NBUCKE|
|00004740| 54 53 3b 20 69 2b 2b 29 | 0d 20 20 20 20 7b 0d 20 |TS; i++)|. {. |
|00004750| 20 20 20 20 20 72 65 67 | 69 73 74 65 72 20 73 74 | reg|ister st|
|00004760| 72 75 63 74 20 74 61 62 | 6c 65 5f 65 6c 74 20 2a |ruct tab|le_elt *|
|00004770| 74 68 69 73 2c 20 2a 6e | 65 78 74 3b 0d 20 20 20 |this, *n|ext;. |
|00004780| 20 20 20 66 6f 72 20 28 | 74 68 69 73 20 3d 20 74 | for (|this = t|
|00004790| 61 62 6c 65 5b 69 5d 3b | 20 74 68 69 73 3b 20 74 |able[i];| this; t|
|000047a0| 68 69 73 20 3d 20 6e 65 | 78 74 29 0d 09 7b 0d 09 |his = ne|xt)..{..|
|000047b0| 20 20 6e 65 78 74 20 3d | 20 74 68 69 73 2d 3e 6e | next =| this->n|
|000047c0| 65 78 74 5f 73 61 6d 65 | 5f 68 61 73 68 3b 0d 09 |ext_same|_hash;..|
|000047d0| 20 20 66 72 65 65 5f 65 | 6c 65 6d 65 6e 74 20 28 | free_e|lement (|
|000047e0| 74 68 69 73 29 3b 0d 09 | 7d 0d 20 20 20 20 7d 0d |this);..|}. }.|
|000047f0| 0d 20 20 62 7a 65 72 6f | 20 28 74 61 62 6c 65 2c |. bzero| (table,|
|00004800| 20 73 69 7a 65 6f 66 20 | 74 61 62 6c 65 29 3b 0d | sizeof |table);.|
|00004810| 0d 20 20 70 72 65 76 5f | 69 6e 73 6e 5f 63 63 30 |. prev_|insn_cc0|
|00004820| 20 3d 20 30 3b 0d 20 20 | 70 72 65 76 5f 69 6e 73 | = 0;. |prev_ins|
|00004830| 6e 5f 65 78 70 6c 69 63 | 69 74 5f 63 63 30 20 3d |n_explic|it_cc0 =|
|00004840| 20 30 3b 0d 20 20 70 72 | 65 76 5f 69 6e 73 6e 20 | 0;. pr|ev_insn |
|00004850| 3d 20 30 3b 0d 7d 0d 0d | 2f 2a 20 53 61 79 20 74 |= 0;.}..|/* Say t|
|00004860| 68 61 74 20 72 65 67 69 | 73 74 65 72 20 52 45 47 |hat regi|ster REG|
|00004870| 20 63 6f 6e 74 61 69 6e | 73 20 61 20 71 75 61 6e | contain|s a quan|
|00004880| 74 69 74 79 20 6e 6f 74 | 20 69 6e 20 61 6e 79 20 |tity not| in any |
|00004890| 72 65 67 69 73 74 65 72 | 20 62 65 66 6f 72 65 2e |register| before.|
|000048a0| 20 20 2a 2f 0d 0d 73 74 | 61 74 69 63 20 76 6f 69 | */..st|atic voi|
|000048b0| 64 0d 6d 61 6b 65 5f 6e | 65 77 5f 71 74 79 20 28 |d.make_n|ew_qty (|
|000048c0| 72 65 67 29 0d 20 20 20 | 20 20 72 65 67 69 73 74 |reg). | regist|
|000048d0| 65 72 20 69 6e 74 20 72 | 65 67 3b 0d 7b 0d 20 20 |er int r|eg;.{. |
|000048e0| 72 65 67 69 73 74 65 72 | 20 69 6e 74 20 71 3b 0d |register| int q;.|
|000048f0| 0d 20 20 71 20 3d 20 72 | 65 67 5f 71 74 79 5b 72 |. q = r|eg_qty[r|
|00004900| 65 67 5d 20 3d 20 6e 65 | 78 74 5f 71 74 79 2b 2b |eg] = ne|xt_qty++|
|00004910| 3b 0d 20 20 71 74 79 5f | 66 69 72 73 74 5f 72 65 |;. qty_|first_re|
|00004920| 67 5b 71 5d 20 3d 20 72 | 65 67 3b 0d 20 20 71 74 |g[q] = r|eg;. qt|
|00004930| 79 5f 6c 61 73 74 5f 72 | 65 67 5b 71 5d 20 3d 20 |y_last_r|eg[q] = |
|00004940| 72 65 67 3b 0d 7d 0d 0d | 2f 2a 20 4d 61 6b 65 20 |reg;.}..|/* Make |
|00004950| 72 65 67 20 4e 45 57 20 | 65 71 75 69 76 61 6c 65 |reg NEW |equivale|
|00004960| 6e 74 20 74 6f 20 72 65 | 67 20 4f 4c 44 2e 0d 20 |nt to re|g OLD.. |
|00004970| 20 20 4f 4c 44 20 69 73 | 20 6e 6f 74 20 63 68 61 | OLD is| not cha|
|00004980| 6e 67 69 6e 67 3b 20 4e | 45 57 20 69 73 2e 20 20 |nging; N|EW is. |
|00004990| 2a 2f 0d 0d 73 74 61 74 | 69 63 20 76 6f 69 64 0d |*/..stat|ic void.|
|000049a0| 6d 61 6b 65 5f 72 65 67 | 73 5f 65 71 76 20 28 6e |make_reg|s_eqv (n|
|000049b0| 65 77 2c 20 6f 6c 64 29 | 0d 20 20 20 20 20 72 65 |ew, old)|. re|
|000049c0| 67 69 73 74 65 72 20 69 | 6e 74 20 6e 65 77 2c 20 |gister i|nt new, |
|000049d0| 6f 6c 64 3b 0d 7b 0d 20 | 20 72 65 67 69 73 74 65 |old;.{. | registe|
|000049e0| 72 20 69 6e 74 20 6c 61 | 73 74 72 2c 20 66 69 72 |r int la|str, fir|
|000049f0| 73 74 72 3b 0d 20 20 72 | 65 67 69 73 74 65 72 20 |str;. r|egister |
|00004a00| 69 6e 74 20 71 20 3d 20 | 72 65 67 5f 71 74 79 5b |int q = |reg_qty[|
|00004a10| 6f 6c 64 5d 3b 0d 0d 20 | 20 2f 2a 20 4e 6f 74 68 |old];.. | /* Noth|
|00004a20| 69 6e 67 20 73 68 6f 75 | 6c 64 20 62 65 63 6f 6d |ing shou|ld becom|
|00004a30| 65 20 65 71 76 20 75 6e | 74 69 6c 20 69 74 20 68 |e eqv un|til it h|
|00004a40| 61 73 20 61 20 22 6e 6f | 6e 2d 69 6e 76 61 6c 69 |as a "no|n-invali|
|00004a50| 64 22 20 71 74 79 20 6e | 75 6d 62 65 72 2e 20 20 |d" qty n|umber. |
|00004a60| 2a 2f 0d 20 20 69 66 20 | 28 71 20 3d 3d 20 6f 6c |*/. if |(q == ol|
|00004a70| 64 29 0d 20 20 20 20 61 | 62 6f 72 74 20 28 29 3b |d). a|bort ();|
|00004a80| 0d 0d 20 20 72 65 67 5f | 71 74 79 5b 6e 65 77 5d |.. reg_|qty[new]|
|00004a90| 20 3d 20 71 3b 0d 20 20 | 66 69 72 73 74 72 20 3d | = q;. |firstr =|
|00004aa0| 20 71 74 79 5f 66 69 72 | 73 74 5f 72 65 67 5b 71 | qty_fir|st_reg[q|
|00004ab0| 5d 3b 0d 20 20 6c 61 73 | 74 72 20 3d 20 71 74 79 |];. las|tr = qty|
|00004ac0| 5f 6c 61 73 74 5f 72 65 | 67 5b 71 5d 3b 0d 0d 20 |_last_re|g[q];.. |
|00004ad0| 20 2f 2a 20 50 72 65 66 | 65 72 20 70 73 65 75 64 | /* Pref|er pseud|
|00004ae0| 6f 20 72 65 67 73 20 74 | 6f 20 68 61 72 64 20 72 |o regs t|o hard r|
|00004af0| 65 67 73 20 77 69 74 68 | 20 74 68 65 20 73 61 6d |egs with| the sam|
|00004b00| 65 20 76 61 6c 75 65 2e | 0d 20 20 20 20 20 41 6d |e value.|. Am|
|00004b10| 6f 6e 67 20 70 73 65 75 | 64 6f 73 2c 20 69 66 20 |ong pseu|dos, if |
|00004b20| 4e 45 57 20 77 69 6c 6c | 20 6c 69 76 65 20 6c 6f |NEW will| live lo|
|00004b30| 6e 67 65 72 20 74 68 61 | 6e 20 61 6e 79 20 6f 74 |nger tha|n any ot|
|00004b40| 68 65 72 20 72 65 67 20 | 6f 66 20 74 68 65 20 73 |her reg |of the s|
|00004b50| 61 6d 65 20 71 74 79 2c | 0d 20 20 20 20 20 61 6e |ame qty,|. an|
|00004b60| 64 20 74 68 61 74 20 69 | 73 20 62 65 79 6f 6e 64 |d that i|s beyond|
|00004b70| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 62 61 73 | the cur|rent bas|
|00004b80| 69 63 20 62 6c 6f 63 6b | 2c 0d 20 20 20 20 20 6d |ic block|,. m|
|00004b90| 61 6b 65 20 69 74 20 74 | 68 65 20 6e 65 77 20 63 |ake it t|he new c|
|00004ba0| 61 6e 6f 6e 69 63 61 6c | 20 72 65 70 6c 61 63 65 |anonical| replace|
|00004bb0| 6d 65 6e 74 20 66 6f 72 | 20 74 68 69 73 20 71 74 |ment for| this qt|
|00004bc0| 79 2e 20 20 2a 2f 0d 20 | 20 69 66 20 28 6e 65 77 |y. */. | if (new|
|00004bd0| 20 3e 3d 20 46 49 52 53 | 54 5f 50 53 45 55 44 4f | >= FIRS|T_PSEUDO|
|00004be0| 5f 52 45 47 49 53 54 45 | 52 0d 20 20 20 20 20 20 |_REGISTE|R. |
|00004bf0| 26 26 20 28 66 69 72 73 | 74 72 20 3c 20 46 49 52 |&& (firs|tr < FIR|
|00004c00| 53 54 5f 50 53 45 55 44 | 4f 5f 52 45 47 49 53 54 |ST_PSEUD|O_REGIST|
|00004c10| 45 52 0d 23 69 66 64 65 | 66 20 4d 50 57 5f 43 0d |ER.#ifde|f MPW_C.|
|00004c20| 09 20 20 7c 7c 20 28 28 | 75 69 64 5f 63 75 69 64 |. || ((|uid_cuid|
|00004c30| 5b 2a 28 72 65 67 6e 6f | 5f 6c 61 73 74 5f 75 69 |[*(regno|_last_ui|
|00004c40| 64 2b 6e 65 77 29 5d 20 | 3e 20 63 73 65 5f 62 61 |d+new)] |> cse_ba|
|00004c50| 73 69 63 5f 62 6c 6f 63 | 6b 5f 65 6e 64 0d 09 20 |sic_bloc|k_end.. |
|00004c60| 20 20 20 20 20 20 7c 7c | 20 75 69 64 5f 63 75 69 | ||| uid_cui|
|00004c70| 64 5b 2a 28 72 65 67 6e | 6f 5f 66 69 72 73 74 5f |d[*(regn|o_first_|
|00004c80| 75 69 64 2b 6e 65 77 29 | 5d 20 3c 20 63 73 65 5f |uid+new)|] < cse_|
|00004c90| 62 61 73 69 63 5f 62 6c | 6f 63 6b 5f 73 74 61 72 |basic_bl|ock_star|
|00004ca0| 74 29 0d 09 20 20 20 20 | 20 20 26 26 20 28 75 69 |t).. | && (ui|
|00004cb0| 64 5f 63 75 69 64 5b 2a | 28 72 65 67 6e 6f 5f 6c |d_cuid[*|(regno_l|
|00004cc0| 61 73 74 5f 75 69 64 2b | 6e 65 77 29 5d 0d 09 09 |ast_uid+|new)]...|
|00004cd0| 20 20 3e 20 75 69 64 5f | 63 75 69 64 5b 2a 28 72 | > uid_|cuid[*(r|
|00004ce0| 65 67 6e 6f 5f 6c 61 73 | 74 5f 75 69 64 2b 66 69 |egno_las|t_uid+fi|
|00004cf0| 72 73 74 72 29 5d 29 29 | 29 29 0d 23 65 6c 73 65 |rstr)]))|)).#else|
|00004d00| 0d 09 20 20 7c 7c 20 28 | 28 75 69 64 5f 63 75 69 |.. || (|(uid_cui|
|00004d10| 64 5b 72 65 67 6e 6f 5f | 6c 61 73 74 5f 75 69 64 |d[regno_|last_uid|
|00004d20| 5b 6e 65 77 5d 5d 20 3e | 20 63 73 65 5f 62 61 73 |[new]] >| cse_bas|
|00004d30| 69 63 5f 62 6c 6f 63 6b | 5f 65 6e 64 0d 09 20 20 |ic_block|_end.. |
|00004d40| 20 20 20 20 20 7c 7c 20 | 75 69 64 5f 63 75 69 64 | || |uid_cuid|
|00004d50| 5b 72 65 67 6e 6f 5f 66 | 69 72 73 74 5f 75 69 64 |[regno_f|irst_uid|
|00004d60| 5b 6e 65 77 5d 5d 20 3c | 20 63 73 65 5f 62 61 73 |[new]] <| cse_bas|
|00004d70| 69 63 5f 62 6c 6f 63 6b | 5f 73 74 61 72 74 29 0d |ic_block|_start).|
|00004d80| 09 20 20 20 20 20 20 26 | 26 20 28 75 69 64 5f 63 |. &|& (uid_c|
|00004d90| 75 69 64 5b 72 65 67 6e | 6f 5f 6c 61 73 74 5f 75 |uid[regn|o_last_u|
|00004da0| 69 64 5b 6e 65 77 5d 5d | 0d 09 09 20 20 3e 20 75 |id[new]]|... > u|
|00004db0| 69 64 5f 63 75 69 64 5b | 72 65 67 6e 6f 5f 6c 61 |id_cuid[|regno_la|
|00004dc0| 73 74 5f 75 69 64 5b 66 | 69 72 73 74 72 5d 5d 29 |st_uid[f|irstr]])|
|00004dd0| 29 29 29 0d 23 65 6e 64 | 69 66 20 2f 2a 20 4d 50 |))).#end|if /* MP|
|00004de0| 57 5f 43 20 2a 2f 0d 20 | 20 20 20 7b 0d 20 20 20 |W_C */. | {. |
|00004df0| 20 20 20 72 65 67 5f 70 | 72 65 76 5f 65 71 76 5b | reg_p|rev_eqv[|
|00004e00| 66 69 72 73 74 72 5d 20 | 3d 20 6e 65 77 3b 0d 20 |firstr] |= new;. |
|00004e10| 20 20 20 20 20 72 65 67 | 5f 6e 65 78 74 5f 65 71 | reg|_next_eq|
|00004e20| 76 5b 6e 65 77 5d 20 3d | 20 66 69 72 73 74 72 3b |v[new] =| firstr;|
|00004e30| 0d 20 20 20 20 20 20 72 | 65 67 5f 70 72 65 76 5f |. r|eg_prev_|
|00004e40| 65 71 76 5b 6e 65 77 5d | 20 3d 20 2d 31 3b 0d 20 |eqv[new]| = -1;. |
|00004e50| 20 20 20 20 20 71 74 79 | 5f 66 69 72 73 74 5f 72 | qty|_first_r|
|00004e60| 65 67 5b 71 5d 20 3d 20 | 6e 65 77 3b 0d 20 20 20 |eg[q] = |new;. |
|00004e70| 20 7d 0d 20 20 65 6c 73 | 65 0d 20 20 20 20 7b 0d | }. els|e. {.|
|00004e80| 20 20 20 20 20 20 2f 2a | 20 49 66 20 4e 45 57 20 | /*| If NEW |
|00004e90| 69 73 20 61 20 68 61 72 | 64 20 72 65 67 2c 20 69 |is a har|d reg, i|
|00004ea0| 6e 73 65 72 74 20 61 74 | 20 65 6e 64 2e 0d 09 20 |nsert at| end... |
|00004eb0| 4f 74 68 65 72 77 69 73 | 65 2c 20 69 6e 73 65 72 |Otherwis|e, inser|
|00004ec0| 74 20 62 65 66 6f 72 65 | 20 61 6e 79 20 68 61 72 |t before| any har|
|00004ed0| 64 20 72 65 67 73 20 74 | 68 61 74 20 61 72 65 20 |d regs t|hat are |
|00004ee0| 61 74 20 74 68 65 20 65 | 6e 64 2e 20 20 2a 2f 0d |at the e|nd. */.|
|00004ef0| 20 20 20 20 20 20 77 68 | 69 6c 65 20 28 6c 61 73 | wh|ile (las|
|00004f00| 74 72 20 3c 20 46 49 52 | 53 54 5f 50 53 45 55 44 |tr < FIR|ST_PSEUD|
|00004f10| 4f 5f 52 45 47 49 53 54 | 45 52 20 26 26 20 6e 65 |O_REGIST|ER && ne|
|00004f20| 77 20 3e 3d 20 46 49 52 | 53 54 5f 50 53 45 55 44 |w >= FIR|ST_PSEUD|
|00004f30| 4f 5f 52 45 47 49 53 54 | 45 52 29 0d 09 6c 61 73 |O_REGIST|ER)..las|
|00004f40| 74 72 20 3d 20 72 65 67 | 5f 70 72 65 76 5f 65 71 |tr = reg|_prev_eq|
|00004f50| 76 5b 6c 61 73 74 72 5d | 3b 0d 20 20 20 20 20 20 |v[lastr]|;. |
|00004f60| 72 65 67 5f 6e 65 78 74 | 5f 65 71 76 5b 6e 65 77 |reg_next|_eqv[new|
|00004f70| 5d 20 3d 20 72 65 67 5f | 6e 65 78 74 5f 65 71 76 |] = reg_|next_eqv|
|00004f80| 5b 6c 61 73 74 72 5d 3b | 0d 20 20 20 20 20 20 69 |[lastr];|. i|
|00004f90| 66 20 28 72 65 67 5f 6e | 65 78 74 5f 65 71 76 5b |f (reg_n|ext_eqv[|
|00004fa0| 6c 61 73 74 72 5d 20 3e | 3d 20 30 29 0d 23 69 66 |lastr] >|= 0).#if|
|00004fb0| 64 65 66 20 4d 50 57 5f | 43 0d 09 72 65 67 5f 70 |def MPW_|C..reg_p|
|00004fc0| 72 65 76 5f 65 71 76 5b | 2a 28 72 65 67 5f 6e 65 |rev_eqv[|*(reg_ne|
|00004fd0| 78 74 5f 65 71 76 2b 6c | 61 73 74 72 29 5d 20 3d |xt_eqv+l|astr)] =|
|00004fe0| 20 6e 65 77 3b 0d 23 65 | 6c 73 65 0d 09 72 65 67 | new;.#e|lse..reg|
|00004ff0| 5f 70 72 65 76 5f 65 71 | 76 5b 72 65 67 5f 6e 65 |_prev_eq|v[reg_ne|
|00005000| 78 74 5f 65 71 76 5b 6c | 61 73 74 72 5d 5d 20 3d |xt_eqv[l|astr]] =|
|00005010| 20 6e 65 77 3b 0d 23 65 | 6e 64 69 66 20 2f 2a 20 | new;.#e|ndif /* |
|00005020| 4d 50 57 5f 43 20 2a 2f | 0d 20 20 20 20 20 20 65 |MPW_C */|. e|
|00005030| 6c 73 65 0d 09 71 74 79 | 5f 6c 61 73 74 5f 72 65 |lse..qty|_last_re|
|00005040| 67 5b 71 5d 20 3d 20 6e | 65 77 3b 0d 20 20 20 20 |g[q] = n|ew;. |
|00005050| 20 20 72 65 67 5f 6e 65 | 78 74 5f 65 71 76 5b 6c | reg_ne|xt_eqv[l|
|00005060| 61 73 74 72 5d 20 3d 20 | 6e 65 77 3b 0d 20 20 20 |astr] = |new;. |
|00005070| 20 20 20 72 65 67 5f 70 | 72 65 76 5f 65 71 76 5b | reg_p|rev_eqv[|
|00005080| 6e 65 77 5d 20 3d 20 6c | 61 73 74 72 3b 0d 20 20 |new] = l|astr;. |
|00005090| 20 20 7d 0d 7d 0d 0d 2f | 2a 20 44 69 73 63 61 72 | }.}../|* Discar|
|000050a0| 64 20 74 68 65 20 72 65 | 63 6f 72 64 73 20 6f 66 |d the re|cords of|
|000050b0| 20 77 68 61 74 20 69 73 | 20 69 6e 20 72 65 67 69 | what is| in regi|
|000050c0| 73 74 65 72 20 52 45 47 | 2e 20 20 2a 2f 0d 0d 73 |ster REG|. */..s|
|000050d0| 74 61 74 69 63 20 76 6f | 69 64 0d 72 65 67 5f 69 |tatic vo|id.reg_i|
|000050e0| 6e 76 61 6c 69 64 61 74 | 65 20 28 72 65 67 29 0d |nvalidat|e (reg).|
|000050f0| 20 20 20 20 20 72 65 67 | 69 73 74 65 72 20 69 6e | reg|ister in|
|00005100| 74 20 72 65 67 3b 0d 7b | 0d 20 20 72 65 67 69 73 |t reg;.{|. regis|
|00005110| 74 65 72 20 69 6e 74 20 | 6e 20 3d 20 72 65 67 5f |ter int |n = reg_|
|00005120| 6e 65 78 74 5f 65 71 76 | 5b 72 65 67 5d 3b 0d 20 |next_eqv|[reg];. |
|00005130| 20 72 65 67 69 73 74 65 | 72 20 69 6e 74 20 70 20 | registe|r int p |
|00005140| 3d 20 72 65 67 5f 70 72 | 65 76 5f 65 71 76 5b 72 |= reg_pr|ev_eqv[r|
|00005150| 65 67 5d 3b 0d 20 20 72 | 65 67 69 73 74 65 72 20 |eg];. r|egister |
|00005160| 69 6e 74 20 71 20 3d 20 | 72 65 67 5f 71 74 79 5b |int q = |reg_qty[|
|00005170| 72 65 67 5d 3b 0d 0d 20 | 20 72 65 67 5f 74 69 63 |reg];.. | reg_tic|
|00005180| 6b 5b 72 65 67 5d 2b 2b | 3b 0d 0d 20 20 69 66 20 |k[reg]++|;.. if |
|00005190| 28 71 20 3d 3d 20 72 65 | 67 29 0d 20 20 20 20 7b |(q == re|g). {|
|000051a0| 0d 20 20 20 20 20 20 2f | 2a 20 53 61 76 65 20 74 |. /|* Save t|
|000051b0| 69 6d 65 20 69 66 20 61 | 6c 72 65 61 64 79 20 69 |ime if a|lready i|
|000051c0| 6e 76 61 6c 69 64 20 2a | 2f 0d 20 20 20 20 20 20 |nvalid *|/. |
|000051d0| 2f 2a 20 49 74 20 73 68 | 6f 75 6c 64 6e 27 74 20 |/* It sh|ouldn't |
|000051e0| 62 65 20 6c 69 6e 6b 65 | 64 20 74 6f 20 61 6e 79 |be linke|d to any|
|000051f0| 74 68 69 6e 67 20 69 66 | 20 69 74 27 73 20 69 6e |thing if| it's in|
|00005200| 76 61 6c 69 64 2e 20 20 | 2a 2f 0d 20 20 20 20 20 |valid. |*/. |
|00005210| 20 69 66 20 28 72 65 67 | 5f 70 72 65 76 5f 65 71 | if (reg|_prev_eq|
|00005220| 76 5b 71 5d 20 21 3d 20 | 2d 31 29 0d 09 61 62 6f |v[q] != |-1)..abo|
|00005230| 72 74 20 28 29 3b 0d 20 | 20 20 20 20 20 69 66 20 |rt ();. | if |
|00005240| 28 72 65 67 5f 6e 65 78 | 74 5f 65 71 76 5b 71 5d |(reg_nex|t_eqv[q]|
|00005250| 20 21 3d 20 2d 31 29 0d | 09 61 62 6f 72 74 20 28 | != -1).|.abort (|
|00005260| 29 3b 0d 20 20 20 20 20 | 20 72 65 74 75 72 6e 3b |);. | return;|
|00005270| 0d 20 20 20 20 7d 0d 0d | 20 20 69 66 20 28 6e 20 |. }..| if (n |
|00005280| 21 3d 20 2d 31 29 0d 20 | 20 20 20 72 65 67 5f 70 |!= -1). | reg_p|
|00005290| 72 65 76 5f 65 71 76 5b | 6e 5d 20 3d 20 70 3b 0d |rev_eqv[|n] = p;.|
|000052a0| 20 20 65 6c 73 65 0d 20 | 20 20 20 71 74 79 5f 6c | else. | qty_l|
|000052b0| 61 73 74 5f 72 65 67 5b | 71 5d 20 3d 20 70 3b 0d |ast_reg[|q] = p;.|
|000052c0| 20 20 69 66 20 28 70 20 | 21 3d 20 2d 31 29 0d 20 | if (p |!= -1). |
|000052d0| 20 20 20 72 65 67 5f 6e | 65 78 74 5f 65 71 76 5b | reg_n|ext_eqv[|
|000052e0| 70 5d 20 3d 20 6e 3b 0d | 20 20 65 6c 73 65 0d 20 |p] = n;.| else. |
|000052f0| 20 20 20 71 74 79 5f 66 | 69 72 73 74 5f 72 65 67 | qty_f|irst_reg|
|00005300| 5b 71 5d 20 3d 20 6e 3b | 0d 0d 20 20 72 65 67 5f |[q] = n;|.. reg_|
|00005310| 71 74 79 5b 72 65 67 5d | 20 3d 20 72 65 67 3b 0d |qty[reg]| = reg;.|
|00005320| 20 20 71 74 79 5f 66 69 | 72 73 74 5f 72 65 67 5b | qty_fi|rst_reg[|
|00005330| 72 65 67 5d 20 3d 20 72 | 65 67 3b 0d 20 20 71 74 |reg] = r|eg;. qt|
|00005340| 79 5f 6c 61 73 74 5f 72 | 65 67 5b 72 65 67 5d 20 |y_last_r|eg[reg] |
|00005350| 3d 20 72 65 67 3b 0d 20 | 20 72 65 67 5f 6e 65 78 |= reg;. | reg_nex|
|00005360| 74 5f 65 71 76 5b 72 65 | 67 5d 20 3d 20 2d 31 3b |t_eqv[re|g] = -1;|
|00005370| 0d 20 20 72 65 67 5f 70 | 72 65 76 5f 65 71 76 5b |. reg_p|rev_eqv[|
|00005380| 72 65 67 5d 20 3d 20 2d | 31 3b 0d 7d 0d 0d 2f 2a |reg] = -|1;.}../*|
|00005390| 20 52 65 6d 6f 76 65 20 | 61 6e 79 20 69 6e 76 61 | Remove |any inva|
|000053a0| 6c 69 64 20 65 78 70 72 | 65 73 73 69 6f 6e 73 20 |lid expr|essions |
|000053b0| 66 72 6f 6d 20 74 68 65 | 20 68 61 73 68 20 74 61 |from the| hash ta|
|000053c0| 62 6c 65 0d 20 20 20 74 | 68 61 74 20 72 65 66 65 |ble. t|hat refe|
|000053d0| 72 20 74 6f 20 61 6e 79 | 20 6f 66 20 74 68 65 20 |r to any| of the |
|000053e0| 72 65 67 69 73 74 65 72 | 73 20 63 6f 6e 74 61 69 |register|s contai|
|000053f0| 6e 65 64 20 69 6e 20 65 | 78 70 72 65 73 73 69 6f |ned in e|xpressio|
|00005400| 6e 20 58 2e 0d 0d 20 20 | 20 4d 61 6b 65 20 73 75 |n X... | Make su|
|00005410| 72 65 20 74 68 61 74 20 | 6e 65 77 6c 79 20 69 6e |re that |newly in|
|00005420| 73 65 72 74 65 64 20 72 | 65 66 65 72 65 6e 63 65 |serted r|eference|
|00005430| 73 20 74 6f 20 74 68 6f | 73 65 20 72 65 67 69 73 |s to tho|se regis|
|00005440| 74 65 72 73 0d 20 20 20 | 61 73 20 73 75 62 65 78 |ters. |as subex|
|00005450| 70 72 65 73 73 69 6f 6e | 73 20 77 69 6c 6c 20 62 |pression|s will b|
|00005460| 65 20 63 6f 6e 73 69 64 | 65 72 65 64 20 76 61 6c |e consid|ered val|
|00005470| 69 64 2e 0d 0d 20 20 20 | 6d 65 6e 74 69 6f 6e 5f |id... |mention_|
|00005480| 72 65 67 73 20 69 73 20 | 6e 6f 74 20 63 61 6c 6c |regs is |not call|
|00005490| 65 64 20 77 68 65 6e 20 | 61 20 72 65 67 69 73 74 |ed when |a regist|
|000054a0| 65 72 20 69 74 73 65 6c | 66 0d 20 20 20 69 73 20 |er itsel|f. is |
|000054b0| 62 65 69 6e 67 20 73 74 | 6f 72 65 64 20 69 6e 20 |being st|ored in |
|000054c0| 74 68 65 20 74 61 62 6c | 65 2e 20 20 2a 2f 0d 0d |the tabl|e. */..|
|000054d0| 73 74 61 74 69 63 20 76 | 6f 69 64 0d 6d 65 6e 74 |static v|oid.ment|
|000054e0| 69 6f 6e 5f 72 65 67 73 | 20 28 78 29 0d 20 20 20 |ion_regs| (x). |
|000054f0| 20 20 72 74 78 20 78 3b | 0d 7b 0d 20 20 72 65 67 | rtx x;|.{. reg|
|00005500| 69 73 74 65 72 20 65 6e | 75 6d 20 72 74 78 5f 63 |ister en|um rtx_c|
|00005510| 6f 64 65 20 63 6f 64 65 | 3b 0d 20 20 72 65 67 69 |ode code|;. regi|
|00005520| 73 74 65 72 20 69 6e 74 | 20 69 2c 20 6a 3b 0d 20 |ster int| i, j;. |
|00005530| 20 72 65 67 69 73 74 65 | 72 20 63 68 61 72 20 2a | registe|r char *|
|00005540| 66 6d 74 3b 0d 0d 20 20 | 69 66 20 28 78 20 3d 3d |fmt;.. |if (x ==|
|00005550| 20 30 29 0d 20 20 20 20 | 72 65 74 75 72 6e 3b 0d | 0). |return;.|
|00005560| 0d 20 20 63 6f 64 65 20 | 3d 20 47 45 54 5f 43 4f |. code |= GET_CO|
|00005570| 44 45 20 28 78 29 3b 0d | 20 20 69 66 20 28 63 6f |DE (x);.| if (co|
|00005580| 64 65 20 3d 3d 20 52 45 | 47 29 0d 20 20 20 20 7b |de == RE|G). {|
|00005590| 0d 20 20 20 20 20 20 72 | 65 67 69 73 74 65 72 20 |. r|egister |
|000055a0| 69 6e 74 20 72 65 67 6e | 6f 20 3d 20 52 45 47 4e |int regn|o = REGN|
|000055b0| 4f 20 28 78 29 3b 0d 20 | 20 20 20 20 20 72 65 67 |O (x);. | reg|
|000055c0| 5f 72 74 78 5b 72 65 67 | 6e 6f 5d 20 3d 20 78 3b |_rtx[reg|no] = x;|
|000055d0| 0d 0d 20 20 20 20 20 20 | 69 66 20 28 72 65 67 5f |.. |if (reg_|
|000055e0| 69 6e 5f 74 61 62 6c 65 | 5b 72 65 67 6e 6f 5d 20 |in_table|[regno] |
|000055f0| 3e 3d 20 30 20 26 26 20 | 72 65 67 5f 69 6e 5f 74 |>= 0 && |reg_in_t|
|00005600| 61 62 6c 65 5b 72 65 67 | 6e 6f 5d 20 21 3d 20 72 |able[reg|no] != r|
|00005610| 65 67 5f 74 69 63 6b 5b | 72 65 67 6e 6f 5d 29 0d |eg_tick[|regno]).|
|00005620| 09 72 65 6d 6f 76 65 5f | 69 6e 76 61 6c 69 64 5f |.remove_|invalid_|
|00005630| 72 65 66 73 20 28 72 65 | 67 6e 6f 29 3b 0d 0d 20 |refs (re|gno);.. |
|00005640| 20 20 20 20 20 72 65 67 | 5f 69 6e 5f 74 61 62 6c | reg|_in_tabl|
|00005650| 65 5b 72 65 67 6e 6f 5d | 20 3d 20 72 65 67 5f 74 |e[regno]| = reg_t|
|00005660| 69 63 6b 5b 72 65 67 6e | 6f 5d 3b 0d 0d 20 20 20 |ick[regn|o];.. |
|00005670| 20 20 20 72 65 74 75 72 | 6e 3b 0d 20 20 20 20 7d | retur|n;. }|
|00005680| 0d 0d 20 20 66 6d 74 20 | 3d 20 47 45 54 5f 52 54 |.. fmt |= GET_RT|
|00005690| 58 5f 46 4f 52 4d 41 54 | 20 28 63 6f 64 65 29 3b |X_FORMAT| (code);|
|000056a0| 0d 20 20 66 6f 72 20 28 | 69 20 3d 20 47 45 54 5f |. for (|i = GET_|
|000056b0| 52 54 58 5f 4c 45 4e 47 | 54 48 20 28 63 6f 64 65 |RTX_LENG|TH (code|
|000056c0| 29 20 2d 20 31 3b 20 69 | 20 3e 3d 20 30 3b 20 69 |) - 1; i| >= 0; i|
|000056d0| 2d 2d 29 0d 20 20 20 20 | 69 66 20 28 66 6d 74 5b |--). |if (fmt[|
|000056e0| 69 5d 20 3d 3d 20 27 65 | 27 29 0d 20 20 20 20 20 |i] == 'e|'). |
|000056f0| 20 6d 65 6e 74 69 6f 6e | 5f 72 65 67 73 20 28 58 | mention|_regs (X|
|00005700| 45 58 50 20 28 78 2c 20 | 69 29 29 3b 0d 20 20 20 |EXP (x, |i));. |
|00005710| 20 65 6c 73 65 20 69 66 | 20 28 66 6d 74 5b 69 5d | else if| (fmt[i]|
|00005720| 20 3d 3d 20 27 45 27 29 | 0d 20 20 20 20 20 20 66 | == 'E')|. f|
|00005730| 6f 72 20 28 6a 20 3d 20 | 30 3b 20 6a 20 3c 20 58 |or (j = |0; j < X|
|00005740| 56 45 43 4c 45 4e 20 28 | 78 2c 20 69 29 3b 20 6a |VECLEN (|x, i); j|
|00005750| 2b 2b 29 0d 09 6d 65 6e | 74 69 6f 6e 5f 72 65 67 |++)..men|tion_reg|
|00005760| 73 20 28 58 56 45 43 45 | 58 50 20 28 78 2c 20 69 |s (XVECE|XP (x, i|
|00005770| 2c 20 6a 29 29 3b 0d 7d | 0d 0d 2f 2a 20 55 70 64 |, j));.}|../* Upd|
|00005780| 61 74 65 20 74 68 65 20 | 72 65 67 69 73 74 65 72 |ate the |register|
|00005790| 20 71 75 61 6e 74 69 74 | 69 65 73 20 66 6f 72 20 | quantit|ies for |
|000057a0| 69 6e 73 65 72 74 69 6e | 67 20 58 20 69 6e 74 6f |insertin|g X into|
|000057b0| 20 74 68 65 20 68 61 73 | 68 20 74 61 62 6c 65 0d | the has|h table.|
|000057c0| 20 20 20 77 69 74 68 20 | 61 20 76 61 6c 75 65 20 | with |a value |
|000057d0| 65 71 75 69 76 61 6c 65 | 6e 74 20 74 6f 20 43 4c |equivale|nt to CL|
|000057e0| 41 53 53 50 2e 0d 20 20 | 20 28 49 66 20 43 4c 41 |ASSP.. | (If CLA|
|000057f0| 53 53 50 20 69 73 20 6e | 6f 74 20 61 20 52 45 47 |SSP is n|ot a REG|
|00005800| 20 6f 72 20 61 20 53 55 | 42 52 45 47 2c 20 69 74 | or a SU|BREG, it|
|00005810| 20 69 73 20 69 72 72 65 | 6c 65 76 61 6e 74 2e 29 | is irre|levant.)|
|00005820| 0d 20 20 20 49 66 20 4d | 4f 44 49 46 49 45 44 20 |. If M|ODIFIED |
|00005830| 69 73 20 6e 6f 6e 7a 65 | 72 6f 2c 20 58 20 69 73 |is nonze|ro, X is|
|00005840| 20 61 20 64 65 73 74 69 | 6e 61 74 69 6f 6e 3b 20 | a desti|nation; |
|00005850| 69 74 20 69 73 20 62 65 | 69 6e 67 20 6d 6f 64 69 |it is be|ing modi|
|00005860| 66 69 65 64 2e 0d 20 20 | 20 4e 6f 74 65 20 74 68 |fied.. | Note th|
|00005870| 61 74 20 72 65 67 5f 69 | 6e 76 61 6c 69 64 61 74 |at reg_i|nvalidat|
|00005880| 65 20 73 68 6f 75 6c 64 | 20 62 65 20 63 61 6c 6c |e should| be call|
|00005890| 65 64 20 6f 6e 20 61 20 | 72 65 67 69 73 74 65 72 |ed on a |register|
|000058a0| 0d 20 20 20 62 65 66 6f | 72 65 20 69 6e 73 65 72 |. befo|re inser|
|000058b0| 74 5f 72 65 67 73 20 69 | 73 20 64 6f 6e 65 20 6f |t_regs i|s done o|
|000058c0| 6e 20 74 68 61 74 20 72 | 65 67 69 73 74 65 72 20 |n that r|egister |
|000058d0| 77 69 74 68 20 4d 4f 44 | 49 46 49 45 44 20 21 3d |with MOD|IFIED !=|
|000058e0| 20 30 2e 0d 0d 20 20 20 | 4e 6f 6e 7a 65 72 6f 20 | 0... |Nonzero |
|000058f0| 76 61 6c 75 65 20 6d 65 | 61 6e 73 20 74 68 61 74 |value me|ans that|
|00005900| 20 65 6c 65 6d 65 6e 74 | 73 20 6f 66 20 72 65 67 | element|s of reg|
|00005910| 5f 71 74 79 20 68 61 76 | 65 20 63 68 61 6e 67 65 |_qty hav|e change|
|00005920| 64 0d 20 20 20 73 6f 20 | 58 27 73 20 68 61 73 68 |d. so |X's hash|
|00005930| 20 63 6f 64 65 20 6d 61 | 79 20 62 65 20 64 69 66 | code ma|y be dif|
|00005940| 66 65 72 65 6e 74 2e 20 | 20 2a 2f 0d 0d 73 74 61 |ferent. | */..sta|
|00005950| 74 69 63 20 69 6e 74 0d | 69 6e 73 65 72 74 5f 72 |tic int.|insert_r|
|00005960| 65 67 73 20 28 78 2c 20 | 63 6c 61 73 73 70 2c 20 |egs (x, |classp, |
|00005970| 6d 6f 64 69 66 69 65 64 | 29 0d 20 20 20 20 20 72 |modified|). r|
|00005980| 74 78 20 78 3b 0d 20 20 | 20 20 20 73 74 72 75 63 |tx x;. | struc|
|00005990| 74 20 74 61 62 6c 65 5f | 65 6c 74 20 2a 63 6c 61 |t table_|elt *cla|
|000059a0| 73 73 70 3b 0d 20 20 20 | 20 20 69 6e 74 20 6d 6f |ssp;. | int mo|
|000059b0| 64 69 66 69 65 64 3b 0d | 7b 0d 20 20 69 66 20 28 |dified;.|{. if (|
|000059c0| 47 45 54 5f 43 4f 44 45 | 20 28 78 29 20 3d 3d 20 |GET_CODE| (x) == |
|000059d0| 52 45 47 29 0d 20 20 20 | 20 7b 0d 20 20 20 20 20 |REG). | {. |
|000059e0| 20 72 65 67 69 73 74 65 | 72 20 69 6e 74 20 72 65 | registe|r int re|
|000059f0| 67 6e 6f 20 3d 20 52 45 | 47 4e 4f 20 28 78 29 3b |gno = RE|GNO (x);|
|00005a00| 0d 20 20 20 20 20 20 72 | 65 67 5f 72 74 78 5b 72 |. r|eg_rtx[r|
|00005a10| 65 67 6e 6f 5d 20 3d 20 | 78 3b 0d 20 20 20 20 20 |egno] = |x;. |
|00005a20| 20 69 66 20 28 6d 6f 64 | 69 66 69 65 64 20 7c 7c | if (mod|ified |||
|00005a30| 20 72 65 67 5f 71 74 79 | 5b 72 65 67 6e 6f 5d 20 | reg_qty|[regno] |
|00005a40| 3d 3d 20 72 65 67 6e 6f | 29 0d 09 7b 0d 09 20 20 |== regno|)..{.. |
|00005a50| 69 66 20 28 63 6c 61 73 | 73 70 20 26 26 20 47 45 |if (clas|sp && GE|
|00005a60| 54 5f 43 4f 44 45 20 28 | 63 6c 61 73 73 70 2d 3e |T_CODE (|classp->|
|00005a70| 65 78 70 29 20 3d 3d 20 | 52 45 47 29 0d 09 20 20 |exp) == |REG).. |
|00005a80| 20 20 7b 0d 09 20 20 20 | 20 20 20 6d 61 6b 65 5f | {.. | make_|
|00005a90| 72 65 67 73 5f 65 71 76 | 20 28 72 65 67 6e 6f 2c |regs_eqv| (regno,|
|00005aa0| 20 52 45 47 4e 4f 20 28 | 63 6c 61 73 73 70 2d 3e | REGNO (|classp->|
|00005ab0| 65 78 70 29 29 3b 0d 09 | 20 20 20 20 20 20 2f 2a |exp));..| /*|
|00005ac0| 20 4d 61 6b 65 20 73 75 | 72 65 20 72 65 67 5f 72 | Make su|re reg_r|
|00005ad0| 74 78 20 69 73 20 73 65 | 74 20 75 70 20 65 76 65 |tx is se|t up eve|
|00005ae0| 6e 20 66 6f 72 20 72 65 | 67 73 0d 09 09 20 6e 6f |n for re|gs... no|
|00005af0| 74 20 65 78 70 6c 69 63 | 69 74 6c 79 20 73 65 74 |t explic|itly set|
|00005b00| 20 28 73 75 63 68 20 61 | 73 20 66 75 6e 63 74 69 | (such a|s functi|
|00005b10| 6f 6e 20 76 61 6c 75 65 | 29 2e 20 20 2a 2f 0d 09 |on value|). */..|
|00005b20| 20 20 20 20 20 20 72 65 | 67 5f 72 74 78 5b 52 45 | re|g_rtx[RE|
|00005b30| 47 4e 4f 20 28 63 6c 61 | 73 73 70 2d 3e 65 78 70 |GNO (cla|ssp->exp|
|00005b40| 29 5d 20 3d 20 63 6c 61 | 73 73 70 2d 3e 65 78 70 |)] = cla|ssp->exp|
|00005b50| 3b 0d 09 20 20 20 20 7d | 0d 09 20 20 65 6c 73 65 |;.. }|.. else|
|00005b60| 0d 09 20 20 20 20 6d 61 | 6b 65 5f 6e 65 77 5f 71 |.. ma|ke_new_q|
|00005b70| 74 79 20 28 72 65 67 6e | 6f 29 3b 0d 09 20 20 72 |ty (regn|o);.. r|
|00005b80| 65 74 75 72 6e 20 31 3b | 0d 09 7d 0d 20 20 20 20 |eturn 1;|..}. |
|00005b90| 7d 0d 20 20 2f 2a 20 43 | 6f 70 79 69 6e 67 20 61 |}. /* C|opying a|
|00005ba0| 20 73 75 62 72 65 67 20 | 69 6e 74 6f 20 61 20 73 | subreg |into a s|
|00005bb0| 75 62 72 65 67 20 6d 61 | 6b 65 73 20 74 68 65 20 |ubreg ma|kes the |
|00005bc0| 72 65 67 73 20 65 71 75 | 69 76 61 6c 65 6e 74 2c |regs equ|ivalent,|
|00005bd0| 0d 20 20 20 20 20 62 75 | 74 20 6f 6e 6c 79 20 69 |. bu|t only i|
|00005be0| 66 20 74 68 65 20 65 6e | 74 69 72 65 20 72 65 67 |f the en|tire reg|
|00005bf0| 73 27 20 6d 6f 64 65 20 | 69 73 20 77 69 74 68 69 |s' mode |is withi|
|00005c00| 6e 20 6f 6e 65 20 77 6f | 72 64 2e 0d 20 20 20 20 |n one wo|rd.. |
|00005c10| 20 43 6f 70 79 69 6e 67 | 20 6f 6e 65 20 72 65 67 | Copying| one reg|
|00005c20| 20 6f 66 20 61 20 44 49 | 6d 6f 64 65 20 69 6e 74 | of a DI|mode int|
|00005c30| 6f 20 6f 6e 65 20 72 65 | 67 20 6f 66 20 61 6e 6f |o one re|g of ano|
|00005c40| 74 68 65 72 20 44 49 6d | 6f 64 65 0d 20 20 20 20 |ther DIm|ode. |
|00005c50| 20 64 6f 65 73 20 6e 6f | 74 20 6d 61 6b 65 20 74 | does no|t make t|
|00005c60| 68 65 6d 20 65 71 75 69 | 76 61 6c 65 6e 74 2e 20 |hem equi|valent. |
|00005c70| 20 2a 2f 0d 20 20 65 6c | 73 65 20 69 66 20 28 47 | */. el|se if (G|
|00005c80| 45 54 5f 43 4f 44 45 20 | 28 78 29 20 3d 3d 20 53 |ET_CODE |(x) == S|
|00005c90| 55 42 52 45 47 0d 09 20 | 20 20 26 26 20 47 45 54 |UBREG.. | && GET|
|00005ca0| 5f 43 4f 44 45 20 28 53 | 55 42 52 45 47 5f 52 45 |_CODE (S|UBREG_RE|
|00005cb0| 47 20 28 78 29 29 20 3d | 3d 20 52 45 47 0d 09 20 |G (x)) =|= REG.. |
|00005cc0| 20 20 26 26 20 47 45 54 | 5f 4d 4f 44 45 5f 53 49 | && GET|_MODE_SI|
|00005cd0| 5a 45 20 28 47 45 54 5f | 4d 4f 44 45 20 28 53 55 |ZE (GET_|MODE (SU|
|00005ce0| 42 52 45 47 5f 52 45 47 | 20 28 78 29 29 29 20 3c |BREG_REG| (x))) <|
|00005cf0| 3d 20 55 4e 49 54 53 5f | 50 45 52 5f 57 4f 52 44 |= UNITS_|PER_WORD|
|00005d00| 0d 09 20 20 20 26 26 20 | 28 6d 6f 64 69 66 69 65 |.. && |(modifie|
|00005d10| 64 0d 09 20 20 20 20 20 | 20 20 7c 7c 20 72 65 67 |d.. | || reg|
|00005d20| 5f 71 74 79 5b 52 45 47 | 4e 4f 20 28 53 55 42 52 |_qty[REG|NO (SUBR|
|00005d30| 45 47 5f 52 45 47 20 28 | 78 29 29 5d 20 3d 3d 20 |EG_REG (|x))] == |
|00005d40| 52 45 47 4e 4f 20 28 53 | 55 42 52 45 47 5f 52 45 |REGNO (S|UBREG_RE|
|00005d50| 47 20 28 78 29 29 29 29 | 0d 20 20 20 20 7b 0d 20 |G (x))))|. {. |
|00005d60| 20 20 20 20 20 69 66 20 | 28 63 6c 61 73 73 70 20 | if |(classp |
|00005d70| 26 26 20 47 45 54 5f 43 | 4f 44 45 20 28 63 6c 61 |&& GET_C|ODE (cla|
|00005d80| 73 73 70 2d 3e 65 78 70 | 29 20 3d 3d 20 53 55 42 |ssp->exp|) == SUB|
|00005d90| 52 45 47 0d 09 20 20 26 | 26 20 47 45 54 5f 43 4f |REG.. &|& GET_CO|
|00005da0| 44 45 20 28 53 55 42 52 | 45 47 5f 52 45 47 20 28 |DE (SUBR|EG_REG (|
|00005db0| 63 6c 61 73 73 70 2d 3e | 65 78 70 29 29 20 3d 3d |classp->|exp)) ==|
|00005dc0| 20 52 45 47 0d 09 20 20 | 26 26 20 47 45 54 5f 4d | REG.. |&& GET_M|
|00005dd0| 4f 44 45 20 28 53 55 42 | 52 45 47 5f 52 45 47 20 |ODE (SUB|REG_REG |
|00005de0| 28 63 6c 61 73 73 70 2d | 3e 65 78 70 29 29 20 3d |(classp-|>exp)) =|
|00005df0| 3d 20 47 45 54 5f 4d 4f | 44 45 20 28 53 55 42 52 |= GET_MO|DE (SUBR|
|00005e00| 45 47 5f 52 45 47 20 28 | 78 29 29 29 0d 09 7b 0d |EG_REG (|x)))..{.|
|00005e10| 09 20 20 69 6e 74 20 6f | 72 65 67 6e 6f 20 3d 20 |. int o|regno = |
|00005e20| 52 45 47 4e 4f 20 28 53 | 55 42 52 45 47 5f 52 45 |REGNO (S|UBREG_RE|
|00005e30| 47 20 28 63 6c 61 73 73 | 70 2d 3e 65 78 70 29 29 |G (class|p->exp))|
|00005e40| 3b 0d 09 20 20 6d 61 6b | 65 5f 72 65 67 73 5f 65 |;.. mak|e_regs_e|
|00005e50| 71 76 20 28 52 45 47 4e | 4f 20 28 53 55 42 52 45 |qv (REGN|O (SUBRE|
|00005e60| 47 5f 52 45 47 20 28 78 | 29 29 2c 20 6f 72 65 67 |G_REG (x|)), oreg|
|00005e70| 6e 6f 29 3b 0d 09 20 20 | 2f 2a 20 4d 61 6b 65 20 |no);.. |/* Make |
|00005e80| 73 75 72 65 20 72 65 67 | 5f 72 74 78 20 69 73 20 |sure reg|_rtx is |
|00005e90| 73 65 74 20 75 70 20 65 | 76 65 6e 20 66 6f 72 20 |set up e|ven for |
|00005ea0| 72 65 67 73 0d 09 20 20 | 20 20 20 6e 6f 74 20 65 |regs.. | not e|
|00005eb0| 78 70 6c 69 63 69 74 6c | 79 20 73 65 74 20 28 73 |xplicitl|y set (s|
|00005ec0| 75 63 68 20 61 73 20 66 | 75 6e 63 74 69 6f 6e 20 |uch as f|unction |
|00005ed0| 76 61 6c 75 65 29 2e 20 | 20 2a 2f 0d 09 20 20 72 |value). | */.. r|
|00005ee0| 65 67 5f 72 74 78 5b 6f | 72 65 67 6e 6f 5d 20 3d |eg_rtx[o|regno] =|
|00005ef0| 20 53 55 42 52 45 47 5f | 52 45 47 20 28 63 6c 61 | SUBREG_|REG (cla|
|00005f00| 73 73 70 2d 3e 65 78 70 | 29 3b 0d 09 7d 0d 20 20 |ssp->exp|);..}. |
|00005f10| 20 20 20 20 65 6c 73 65 | 0d 09 6d 61 6b 65 5f 6e | else|..make_n|
|00005f20| 65 77 5f 71 74 79 20 28 | 52 45 47 4e 4f 20 28 53 |ew_qty (|REGNO (S|
|00005f30| 55 42 52 45 47 5f 52 45 | 47 20 28 78 29 29 29 3b |UBREG_RE|G (x)));|
|00005f40| 0d 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 31 3b |. r|eturn 1;|
|00005f50| 0d 20 20 20 20 7d 0d 20 | 20 65 6c 73 65 0d 20 20 |. }. | else. |
|00005f60| 20 20 6d 65 6e 74 69 6f | 6e 5f 72 65 67 73 20 28 | mentio|n_regs (|
|00005f70| 78 29 3b 0d 20 20 72 65 | 74 75 72 6e 20 30 3b 0d |x);. re|turn 0;.|
|00005f80| 7d 0d 0c 0d 2f 2a 20 4c | 6f 6f 6b 20 69 6e 20 6f |}.../* L|ook in o|
|00005f90| 72 20 75 70 64 61 74 65 | 20 74 68 65 20 68 61 73 |r update| the has|
|00005fa0| 68 20 74 61 62 6c 65 2e | 20 20 2a 2f 0d 0d 2f 2a |h table.| */../*|
|00005fb0| 20 50 75 74 20 74 68 65 | 20 65 6c 65 6d 65 6e 74 | Put the| element|
|00005fc0| 20 45 4c 54 20 6f 6e 20 | 74 68 65 20 6c 69 73 74 | ELT on |the list|
|00005fd0| 20 6f 66 20 66 72 65 65 | 20 65 6c 65 6d 65 6e 74 | of free| element|
|00005fe0| 73 2e 20 20 2a 2f 0d 0d | 73 74 61 74 69 63 20 76 |s. */..|static v|
|00005ff0| 6f 69 64 0d 66 72 65 65 | 5f 65 6c 65 6d 65 6e 74 |oid.free|_element|
|00006000| 20 28 65 6c 74 29 0d 20 | 20 20 20 20 73 74 72 75 | (elt). | stru|
|00006010| 63 74 20 74 61 62 6c 65 | 5f 65 6c 74 20 2a 65 6c |ct table|_elt *el|
|00006020| 74 3b 0d 7b 0d 20 20 65 | 6c 74 2d 3e 6e 65 78 74 |t;.{. e|lt->next|
|00006030| 5f 73 61 6d 65 5f 68 61 | 73 68 20 3d 20 66 72 65 |_same_ha|sh = fre|
|00006040| 65 5f 65 6c 65 6d 65 6e | 74 5f 63 68 61 69 6e 3b |e_elemen|t_chain;|
|00006050| 0d 20 20 66 72 65 65 5f | 65 6c 65 6d 65 6e 74 5f |. free_|element_|
|00006060| 63 68 61 69 6e 20 3d 20 | 65 6c 74 3b 0d 7d 0d 0d |chain = |elt;.}..|
|00006070| 2f 2a 20 52 65 74 75 72 | 6e 20 61 6e 20 65 6c 65 |/* Retur|n an ele|
|00006080| 6d 65 6e 74 20 74 68 61 | 74 20 69 73 20 66 72 65 |ment tha|t is fre|
|00006090| 65 20 66 6f 72 20 75 73 | 65 2e 20 20 2a 2f 0d 0d |e for us|e. */..|
|000060a0| 73 74 61 74 69 63 20 73 | 74 72 75 63 74 20 74 61 |static s|truct ta|
|000060b0| 62 6c 65 5f 65 6c 74 20 | 2a 0d 67 65 74 5f 65 6c |ble_elt |*.get_el|
|000060c0| 65 6d 65 6e 74 20 28 29 | 0d 7b 0d 20 20 73 74 72 |ement ()|.{. str|
|000060d0| 75 63 74 20 74 61 62 6c | 65 5f 65 6c 74 20 2a 65 |uct tabl|e_elt *e|
|000060e0| 6c 74 20 3d 20 66 72 65 | 65 5f 65 6c 65 6d 65 6e |lt = fre|e_elemen|
|000060f0| 74 5f 63 68 61 69 6e 3b | 0d 20 20 69 66 20 28 65 |t_chain;|. if (e|
|00006100| 6c 74 29 0d 20 20 20 20 | 7b 0d 20 20 20 20 20 20 |lt). |{. |
|00006110| 66 72 65 65 5f 65 6c 65 | 6d 65 6e 74 5f 63 68 61 |free_ele|ment_cha|
|00006120| 69 6e 20 3d 20 65 6c 74 | 2d 3e 6e 65 78 74 5f 73 |in = elt|->next_s|
|00006130| 61 6d 65 5f 68 61 73 68 | 3b 0d 20 20 20 20 20 20 |ame_hash|;. |
|00006140| 72 65 74 75 72 6e 20 65 | 6c 74 3b 0d 20 20 20 20 |return e|lt;. |
|00006150| 7d 0d 20 20 6e 5f 65 6c | 65 6d 65 6e 74 73 5f 6d |}. n_el|ements_m|
|00006160| 61 64 65 2b 2b 3b 0d 20 | 20 72 65 74 75 72 6e 20 |ade++;. | return |
|00006170| 28 73 74 72 75 63 74 20 | 74 61 62 6c 65 5f 65 6c |(struct |table_el|
|00006180| 74 20 2a 29 20 6f 62 61 | 6c 6c 6f 63 20 28 73 69 |t *) oba|lloc (si|
|00006190| 7a 65 6f 66 20 28 73 74 | 72 75 63 74 20 74 61 62 |zeof (st|ruct tab|
|000061a0| 6c 65 5f 65 6c 74 29 29 | 3b 0d 7d 0d 0d 2f 2a 20 |le_elt))|;.}../* |
|000061b0| 52 65 6d 6f 76 65 20 74 | 61 62 6c 65 20 65 6c 65 |Remove t|able ele|
|000061c0| 6d 65 6e 74 20 45 4c 54 | 20 66 72 6f 6d 20 75 73 |ment ELT| from us|
|000061d0| 65 20 69 6e 20 74 68 65 | 20 74 61 62 6c 65 2e 0d |e in the| table..|
|000061e0| 20 20 20 48 41 53 48 20 | 69 73 20 69 74 73 20 68 | HASH |is its h|
|000061f0| 61 73 68 20 63 6f 64 65 | 2c 20 6d 61 64 65 20 75 |ash code|, made u|
|00006200| 73 69 6e 67 20 74 68 65 | 20 48 41 53 48 20 6d 61 |sing the| HASH ma|
|00006210| 63 72 6f 2e 0d 20 20 20 | 49 74 27 73 20 61 6e 20 |cro.. |It's an |
|00006220| 61 72 67 75 6d 65 6e 74 | 20 62 65 63 61 75 73 65 |argument| because|
|00006230| 20 6f 66 74 65 6e 20 74 | 68 61 74 20 69 73 20 6b | often t|hat is k|
|00006240| 6e 6f 77 6e 20 69 6e 20 | 61 64 76 61 6e 63 65 0d |nown in |advance.|
|00006250| 20 20 20 61 6e 64 20 77 | 65 20 73 61 76 65 20 6d | and w|e save m|
|00006260| 75 63 68 20 74 69 6d 65 | 20 6e 6f 74 20 72 65 63 |uch time| not rec|
|00006270| 6f 6d 70 75 74 69 6e 67 | 20 69 74 2e 20 20 2a 2f |omputing| it. */|
|00006280| 0d 0d 73 74 61 74 69 63 | 20 76 6f 69 64 0d 72 65 |..static| void.re|
|00006290| 6d 6f 76 65 20 28 65 6c | 74 2c 20 68 61 73 68 29 |move (el|t, hash)|
|000062a0| 0d 20 20 20 20 20 72 65 | 67 69 73 74 65 72 20 73 |. re|gister s|
|000062b0| 74 72 75 63 74 20 74 61 | 62 6c 65 5f 65 6c 74 20 |truct ta|ble_elt |
|000062c0| 2a 65 6c 74 3b 0d 20 20 | 20 20 20 69 6e 74 20 68 |*elt;. | int h|
|000062d0| 61 73 68 3b 0d 7b 0d 20 | 20 69 66 20 28 65 6c 74 |ash;.{. | if (elt|
|000062e0| 20 3d 3d 20 30 29 0d 20 | 20 20 20 72 65 74 75 72 | == 0). | retur|
|000062f0| 6e 3b 0d 0d 20 20 2f 2a | 20 4d 61 72 6b 20 74 68 |n;.. /*| Mark th|
|00006300| 69 73 20 65 6c 65 6d 65 | 6e 74 20 61 73 20 72 65 |is eleme|nt as re|
|00006310| 6d 6f 76 65 64 2e 20 20 | 53 65 65 20 63 73 65 5f |moved. |See cse_|
|00006320| 69 6e 73 6e 2e 20 20 2a | 2f 0d 20 20 65 6c 74 2d |insn. *|/. elt-|
|00006330| 3e 66 69 72 73 74 5f 73 | 61 6d 65 5f 76 61 6c 75 |>first_s|ame_valu|
|00006340| 65 20 3d 20 30 3b 0d 0d | 20 20 2f 2a 20 52 65 6d |e = 0;..| /* Rem|
|00006350| 6f 76 65 20 74 68 65 20 | 74 61 62 6c 65 20 65 6c |ove the |table el|
|00006360| 65 6d 65 6e 74 20 66 72 | 6f 6d 20 69 74 73 20 65 |ement fr|om its e|
|00006370| 71 75 69 76 61 6c 65 6e | 63 65 20 63 6c 61 73 73 |quivalen|ce class|
|00006380| 2e 20 20 2a 2f 0d 20 20 | 20 20 20 0d 20 20 7b 0d |. */. | . {.|
|00006390| 20 20 20 20 72 65 67 69 | 73 74 65 72 20 73 74 72 | regi|ster str|
|000063a0| 75 63 74 20 74 61 62 6c | 65 5f 65 6c 74 20 2a 70 |uct tabl|e_elt *p|
|000063b0| 72 65 76 20 3d 20 65 6c | 74 2d 3e 70 72 65 76 5f |rev = el|t->prev_|
|000063c0| 73 61 6d 65 5f 76 61 6c | 75 65 3b 0d 20 20 20 20 |same_val|ue;. |
|000063d0| 72 65 67 69 73 74 65 72 | 20 73 74 72 75 63 74 20 |register| struct |
|000063e0| 74 61 62 6c 65 5f 65 6c | 74 20 2a 6e 65 78 74 20 |table_el|t *next |
|000063f0| 3d 20 65 6c 74 2d 3e 6e | 65 78 74 5f 73 61 6d 65 |= elt->n|ext_same|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.